Telerik Forums
UI for WinForms Forum
1 answer
657 views

Hi.

Is it possible to set the CheckState of a parent node independently of how the child nodes are set? In my code, it won't let me change the state if there are different states in child node.

Here's the code, just a simple form with a RadTreeView named "tree" on it:

 

Imports Telerik.WinControls
Imports Telerik.WinControls.UI

Public Class frmTest
    Private Sub frmTest_Load(sender As Object, e As EventArgs) Handles Me.Load
        Me.tree.CheckBoxes = True
        Me.tree.AutoCheckChildNodes = False
        Me.tree.TriStateMode = True

        For i As Integer = 1 To 2
            Dim node As New RadTreeNode("Parent " + i.ToString)
            Me.tree.Nodes.Add(node)
            For j As Integer = 1 To 3
                node.Nodes.Add("Child " + j.ToString)
            Next
        Next

        Me.tree.ExpandAll()

    End Sub

    Private Sub tree_NodeMouseClick(sender As Object, e As RadTreeViewMouseEventArgs) Handles tree.NodeMouseClick

        e.Node.Current = True
        Select Case e.Node.CheckState

            Case Enumerations.ToggleState.On
                e.Node.CheckState = Enumerations.ToggleState.Off
            Case Enumerations.ToggleState.Off
                e.Node.CheckState = Enumerations.ToggleState.Indeterminate
            Case Enumerations.ToggleState.Indeterminate
                'won't change the state on a parent node if not all child nodes are checked!
                e.Node.CheckState = Enumerations.ToggleState.On
        End Select
        e.Node.Current = False

    End Sub

    Private Sub tree_NodeCheckedChanging(sender As Object, e As RadTreeViewCancelEventArgs) Handles tree.NodeCheckedChanging
        If Not e.Node.Current Then
            e.Cancel = True
        End If
    End Sub
End Class

I hope that makes sense..
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Sep 2021
1 answer
336 views

Hi,

I have a RadForm. It has a borderwidth of 4,1,4,4. When I inspected, found that there's a FormImageBorderPrimitive and it has a width of 3,0,3,3. I tried changing the visibility of this element but still the border is there. Is there to remove this border and have only border width of 1,1,1,1

Thanks

Todor
Telerik team
 answered on 17 Sep 2021
0 answers
111 views

Hi,

I'm trying to change the size of the buttons in dock window. I tried changing it via RadControlSpy in runtime as well. But it doesn't seem to change. It is always 22px*22px.

I tried the below code

toolTabStrip.AutoHideButton.ImagePrimitive.Size = new Size(14, 14);
toolTabStrip.AutoHideButton.Size = new Size(14, 14);

Is there a way to change these size ?

Thanks

Kumaran
Top achievements
Rank 1
Iron
 updated question on 17 Sep 2021
3 answers
154 views

In my ListViewType.DetailsView, RadListView control, I have a simple item format method as follows.

        private static void RlvScanMeterNumber_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
        {

            if (e.VisualItem.Selected)
            {
                e.VisualItem.BackColor = Color.Red;
            }
            else
            {
                e.VisualItem.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.None);
            }
        }

Before when I had the reset flag of that ResetValue function set to ValueResetFlags.Local, it DID NOT WORK.

However, after some experimentation, I found that if I used ValueResetFlags.None, it does work!

I am manually adding the list items to the list view, as per the unbound data scenario. So would that have something to do with it?

Why is that?

What do these ValueResetFlags mean?

Stoyan
Telerik team
 answered on 16 Sep 2021
1 answer
448 views

I am currently changing the background row on my RadListView, when click selected via the visual item formatting event like this:


        private static void RadListView_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
        {

            if (e.VisualItem.Selected)
            {
                e.VisualItem.BackColor = Color.Red;
            }
            else
            {
                e.VisualItem.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.None);
            }
        }

This works great when I click on a row to select it. It does change to a red background.

If you click on another row that is not selected, the state does appear to change with the old row reverting back and the new row changing to a red background.

However if you click the same row, the one you just selected, nothing appears to happen.

How can you code up a toggle of a given row's selection state, if you click it once to select and click it again to deselect?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 16 Sep 2021
1 answer
772 views

I have a databound radgridview. 

 

I have added a GridViewHyperLinkColumn as seen below to the grid after the databound.

GridViewHyperlinkColumn col = new GridViewHyperlinkColumn();

                    col.Width = 200;
                    col.FieldName = "Title";
                    col.HeaderText = "Title";
                    col.Name = "Title";
                    col.HyperlinkOpenAction = HyperlinkOpenAction.SingleClick;
                    gvResults.Columns.Insert(5, col);

 

On the CellFormatting I have added the follow to show a short text but a different Hyperlink

 private void gvResults_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
        {
            if(e.Column.Name == "Title")
            {
                string LinkUrl = e.Row.Cells["Path"].Value.ToString();
                string LinkTitle = e.CellElement.Text;
                e.CellElement.Text = $"<html> <a href=\"{LinkUrl}\" >{ LinkTitle}";
                e.CellElement.DisableHTMLRendering = false;
                e.CellElement.ToolTipText = LinkUrl;
            }
        }

 

I have registered

gvResults.HyperlinkOpening += gvResults_HyperlinkOpening;

 

And perform some items during this that include Opening the link using the ProcessStart.

 

My issue is the link opens in a browser before the gvResults_Hyperlink event is called.

I DO NOT want the LINK to open automatically, I want the gvResults_HyperLinkOpening event to do the open.

 

Any suggestions?

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Sep 2021
1 answer
207 views

I've been thinking about it for a few days and couldn't find a solution, so I'm asking for help.

This chart displays product weight values.

In this chart, I want to draw a line according to the change condition of the maximum and minimum criteria.

In this chart, there is no problem in drawing lines without changing based on the minimum and maximum settings.

However, if the min and max values are changed in the middle, I want to draw a new line based on that criteria.

            foreach (DataRow row in dataTable.Rows)
            {
                lineSeries4.DataPoints.Add(new CategoricalDataPoint(double.Parse(row["PRODUCT WEIGHT"].ToString()), row["REC.TIME"].ToString()));
            }

            radChartView.Series.Add(lineSeries4);

            // x축 라벨
            CategoricalAxis categoricalAxis = radChartView.Axes[0] as CategoricalAxis;
            categoricalAxis.LabelInterval = dataTable.Rows.Count / 5;

            // y축 라벨
            LinearAxis verticalAxis = radChartView.Axes[1] as LinearAxis;
            verticalAxis.MajorStep = 0.200;
            verticalAxis.Maximum = double.Parse(sValue[2]) + 0.1;
            verticalAxis.Minimum = double.Parse(sValue[1]) - 0.5;
            //verticalAxis.LabelInterval = 2;
            verticalAxis.LabelFormat = "{0:F3}";

            // 눈금 표현
            CartesianArea area = radChartView.GetArea<CartesianArea>();
            area.ShowGrid = true;
            CartesianGrid grid = area.GetGrid<CartesianGrid>();
            grid.DrawHorizontalFills = true;
            grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Solid;

            // max
            CartesianGridLineAnnotation annotation1 = new CartesianGridLineAnnotation();
            annotation1.Axis = radChartView.Axes[1] as CartesianAxis;
            annotation1.Value = double.Parse(sValue[2]);
            annotation1.BorderColor = Color.Red;
            annotation1.BorderDashStyle = DashStyle.Solid;
            annotation1.BorderWidth = 1;
            annotation1.Label = sValue[2];
            radChartView.Annotations.Add(annotation1);

            // average
            CartesianGridLineAnnotation annotation2 = new CartesianGridLineAnnotation();
            annotation2.Axis = radChartView.Axes[1] as CartesianAxis;
            annotation2.Value = double.Parse(sValue[0]);
            annotation2.BorderColor = Color.Blue;
            annotation2.BorderDashStyle = DashStyle.Solid;
            annotation2.BorderWidth = 1;
            annotation2.Label = sValue[0];
            radChartView.Annotations.Add(annotation2);

            // min
            CartesianGridLineAnnotation annotation3 = new CartesianGridLineAnnotation();
            annotation3.Axis = radChartView.Axes[1] as CartesianAxis;
            annotation3.Value = double.Parse(sValue[1]);
            annotation3.BorderColor = Color.Green;
            annotation3.BorderDashStyle = DashStyle.Solid;
            annotation3.BorderWidth = 1;
            annotation3.Label = sValue[1];
            radChartView.Annotations.Add(annotation3);
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Sep 2021
1 answer
168 views

We have a customized save option and is implemented under the File --> Save (overridden) method. However, the default Ctrl+S is opening up the Savefiledialog and the users are enabled to save a copy. We need to restrict the save to the local disk. Any options on how to override all the possible save options?

 

Thanks,

Kishore

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 Sep 2021
1 answer
189 views

I am required to call an API endpoint, which is return a list of strings. This I have working.

Each item within that list is a daily announcement which is a block of text, that needs to be displaying within a scrolling parent frame. Please refer to the attached .PNG file with a screenshot of the mockup I got from our project managers.

I am not sure which is the best way to do this, as I'm relatively new to Telerik Winform UI. I am looking at either a:

DataGridView
ListControl
List of labels within a panel.

Just trying to find the most effective and simple way to do this. Any suggestions?

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Sep 2021
1 answer
159 views
I have a radtreeview that is filled with a bindinglist from a database.. When I try to add an item to the bindinglist I get a System.OverflowException with the message "Radtreenode can contains 32767 level of items". I can't really figure out what is going wrong.

I don't know if it matters but I am still using the 2012 version because it's a legacy project and we are still upgrading.

Thanks.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Sep 2021
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
+? more
Top users last month
Missing User
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
Missing User
Missing User
Missing User
Want to show your ninja superpower to fellow developers?
Top users last month
Missing User
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
Missing User
Missing User
Missing User
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?