Telerik Forums
UI for WinForms Forum
2 answers
36 views

Hi Dinko and Team,

As I mentioned in my previous forum, The below code is working in VS 2022 with  2013.3.1.1127 where as throwing stackoverflow exception in VS 2022 with Telerk  2024.1.130.48. Out product code structure is like below and we cannot declare and initialize the datatable globally. If we did that the whole application will get impact . Hence could you please restrict the recursive call of Raddropdownlist.Datasource  and Raddropdownlist.SelectedIndex also like Raddropdownlist.SelectedValue. Which I raised in my previous forum

Telerick version 2023.1.314 RadDropDownList controls throwing StackoverflowException when migrating visual studio 2010 to 2022 in UI for WinForms | Telerik Forums

public void fillIndustryProcess()

        {
            try
            {
  System.Data.DataTable dt1 = new System.Data.DataTable();
                if (dt1.Columns.Count <= 0)
                {
                    dt1.Columns.Add("Industry", typeof(string));
                    dt1.Columns.Add("ID", typeof(int));
                    dt1.Rows.Add("USA-0", 0);
                    dt1.Rows.Add("USA-1", 1);
                    dt1.Rows.Add("USA-2", 2);
                    dt1.Rows.Add("USA-3", 3);
                    dt1.Rows.Add("USA-4", 4);

                    radDropDownList2.DisplayMember = "Industry";
                    radDropDownList2.ValueMember = "ID";
                }
  radDropDownList2.DataSource = dt1; ;//Still stack overflow exception occurring when bind the radDropDownList
                radDropDownList2.SelectedIndex = 0;
            }
            catch (System.ComponentModel.Win32Exception ex)
            {
                throw ex;
            }
        }

 

Thanks,

Maheswari

                           
Dinko | Tech Support Engineer
Telerik team
 answered on 14 Feb 2024
1 answer
14 views

Hi Dinko and Team,

As I mentioned in the previous forum, We need fix for Raddropdownlist.SelectedIndex.

When we set SelectedIndex=5 or some value in selectedIndexchangedEvent then the recursive call is happening for SelectedIndex. So we need to restrict the recursive call for both Raddropdownlist.DataSource as well as Raddropdownlist.SelectedIdex.

  private void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
           fillIndustryProcess1(); // radDropDownList1.DataSource = dt; when we set Datasource the recursive call is occurring
            radDropDownList1.SelectedIdex = 5; // radDropDownList1.SelectedIdex = 5; when we set Datasource the recursive call is occurring

}

public void fillIndustryProcess1()
        {
            try
            {
                System.Data.DataTable dt = new System.Data.DataTable();
                if (dt.Columns.Count > 0)
                    {
                        dt.Columns.Add("Industry", typeof(string));
                        dt.Columns.Add("ID", typeof(int));
                        dt.Rows.Add("BGL-0", 0);
                        dt.Rows.Add("BGL-1", 1);
                        dt.Rows.Add("BGL-2", 2);
                        dt.Rows.Add("BGL-3", 3);
                        dt.Rows.Add("BGL-4", 4);
                        radDropDownList1.DisplayMember = "Industry";
                        radDropDownList1.ValueMember = "ID";
                    }
                radDropDownList1.DataSource = dt;// Recursive call occurs
                radDropDownList1.SelectedIndex = 0;/ Recursive call occurs
            }
            catch (System.ComponentModel.Win32Exception ex)
            {
                throw ex;
            }
        }

Old Forums in which , Telerik team fixed the RadDropDownList .SelectedValue.

Telerick version 2023.1.314 RadDropDownList controls throwing StackoverflowException when migrating visual studio 2010 to 2022 in UI for WinForms | Telerik Forums 

Previous forums in which , Telerik team yet to fix for RadDropDownList.Datasource.

Telerick version 2024.1.130.48, RadDropDownList controls throwing StackoverflowException when migrating visual studio 2010 to 2022 in UI for WinForms | Telerik Forums

Thanks,

Maheswari

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Feb 2024
7 answers
82 views

Hi Dinko and team ,

Tried to migrate from Visual studio 2010 project along with Telerik.WinControls.UI.dll - Version - 2013.3.1.1127  to Visual studio 2022 with Telerik.WinControls.UI.dll - Version 2023.1.314.

There are random stackoverflow exceptions throughout project. In older version Telerik 2013.3.1.1127  is working with no issues only in Visual studio 2022  Telerick 2023.1.314 creating issue.

Found the RadDropDownList is the root cause So

As Dinko | Tech Support Engineer Telerik suggested in forum tried the below code

cmbValveSize_SelectedIndexChanged -= cmbValveSize_SelectedIndexChanged;

cmbValveSize.SelectedValue = 3;

cmbValveSize.SelectedIndexChanged += cmbValveSize_SelectedIndexChanged;

The stackoverflow is got resolved at this point so we applied the same code wherever SelectedValue getting assigned throughout project but when we call recursive functions the SelectedValue is getting assigned as null since the assigned value is based on value member signature and datasource datatable also having value. 

    private void setComboBoxIndexChanged(RadDropDownList combobox, object selectedValue, Telerik.WinControls.UI.Data.PositionChangedEventHandler eventHandler)
        {
            if (eventHandler != null) { combobox.SelectedIndexChanged -= eventHandler; }
            if (int.TryParse(Convert.ToString(selectedValue), out int result))
            {       
                combobox.SelectedValue = result; //result having the value but assiging as null
                if (combobox.SelectedValue == null && combobox.Name == "cmbValveSize")
                {
                    DataTable dtValues = (DataTable)cmbValveSize.DataSource;
                   if(dtValues.Rows.Count > 0)
                    {

                    }
                   else
                    {

                    }
                }

 

if (eventHandler != null) { combobox.SelectedIndexChanged += eventHandler; }    

}

 So what is causing in version 2023.1.314  RadDropDownList? why we need to do subscribe and unsubscribe for Telerik 2023.1.314 but not for Telerik 2013.3.1.1127 . What is the change between2013.3.1.1127 and  2023.1.314.

When is the change and Which version will overcome the stackoverflow issue in Visual studio 2022 after  2013.3.1.1127.? - Since we need the latest Telerik version for VS 2022 application.

Unsubscribe and subscribe is not a solution it is affecting the other functionalities of project.

Please suggest what we can do apart from Unsubscribe and subscribe.

Thanks,

Maheswari

Maheswari
Top achievements
Rank 1
Iron
Iron
 answered on 05 Feb 2024
1 answer
30 views

Hi,

I have a RadDropDownList control in my WinForms window. Right now, when I click on this control for the first time since opening a window, the whole text inside RadDropDownList text box is selected.  What I would like to happen is to just set cursor at the end of existing text with no text selection.

I tried handling most of the events for RadDropDownList (like GotFocus or Click) with:

    private void OnGotFocus(object sender, EventArgs e)
    {
      SelectionLength = 0;
      SelectionStart = Text.Length;
    }

When I checked during debugging, the selection is properly changed by my method, but in the end the text is selected whole by something else after that.

How can I get no text selection when clicking first time into this RadDropDownList text box?

Any ideas?

 

Thanks

Wojtek

 

Dinko | Tech Support Engineer
Telerik team
 answered on 01 Feb 2024
1 answer
24 views

Hello,

I created a custom column and cell in my grid following the progress-bar example

https://docs.telerik.com/devtools/winforms/controls/gridview/cells/creating-custom-cells

But I have modified it so that I can view either a textBoxElement or a dropDownListElement depending on what data is in the cell. It all seems to work just fine until I scroll the grid. Scrolling visualy shuffles the data in the custom column. I've tried to take the cell-formatting route but without success. Is it possible to achieve this result somehow?

 Public Class GridParameterValueElement
        Inherits GridDataCellElement

        Public Sub New(ByVal column As GridViewColumn, ByVal row As GridRowElement)
            MyBase.New(column, row)
        End Sub

        Private isInitialized As Boolean
        Private firstTimeIndexChanged As Boolean = True
        Private dropDown As RadDropDownListElement
        Private textBox As RadTextBoxElement
        Protected Overrides Sub CreateChildElements()
            MyBase.CreateChildElements()
            dropDown = New RadDropDownListElement() With { 
                .DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList
            }
            textBox = New RadTextBoxElement() With {
                .Enabled = True,
                .ClickMode = Telerik.WinControls.ClickMode.Press,
                .ZIndex = -1
            }
            If Me.Children.Contains(dropDown) Then Me.Children.Remove(dropDown)
            If Me.Children.Contains(textBox) Then Me.Children.Remove(textBox)
            Me.Children.Add(dropDown)
            Me.Children.Add(textBox)
            AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
            AddHandler textBox.TextChanged, AddressOf TextInBoxChanged
            'AddHandler textBox.Click, AddressOf TextBox_Click

        End Sub

        Protected Overrides Sub DisposeManagedResources()
            RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
            RemoveHandler textBox.TextChanged, AddressOf TextInBoxChanged
            MyBase.DisposeManagedResources()
        End Sub
            
        'Private Sub TextBox_Click(sender As Object, e As EventArgs)
        '    Dim test  = sender
        'End Sub


        Public Overrides Sub SetContent()
            MyBase.SetContent()

            If Me.RowInfo.Cells("DisplayValue").Tag IsNot Nothing Then

                If Not Me.isInitialized Then 
                    If Me.Children.Contains(textBox) Then Me.Children.Remove(textBox)

                    With Me.dropDown
                        .DataSource = Me.RowInfo.Cells("DisplayValue").Tag
                        .ValueMember = ("DevelopmentTypeParameterValueId")
                        .DisplayMember = ("ParameterValue")
                    End With 
                End If

                If Me.RowInfo.Tag IsNot Nothing Then
                    RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
                    dropDown.SelectedIndex = DirectCast(Me.RowInfo.Tag, Integer)
                    AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
                Else
                    RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
                    dropDown.SelectedIndex = -1
                    AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged
                End If

            ElseIf Me.Value IsNot Nothing AndAlso Me.Value IsNot DBNull.Value Then

                If Not Me.isInitialized Then 
                    If Me.Children.Contains(dropDown) Then Me.Children.Remove(dropDown)
                    Me.textBox.Text = CStr(Me.Value)
                End If
       
            End If

            Me.isInitialized = True
        
        End Sub


        Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
            Get
                Return GetType(GridDataCellElement)
            End Get
        End Property

        Public Overrides Function IsCompatible(ByVal data As GridViewColumn, ByVal context As Object) As Boolean
            Return TypeOf data Is GridViewParameterValueColumn AndAlso TypeOf context Is GridDataRowElement
        End Function

    End Class
    
    Public Class GridViewParameterValueColumn
        Inherits GridViewDataColumn
        Public Sub New(ByVal fieldName As String)
            MyBase.New(fieldName)
        End Sub
        Public Overrides Function GetCellType(ByVal row As GridViewRowInfo) As Type
            If TypeOf row Is GridViewDataRowInfo Then
                Return GetType(GridParameterValueElement)
            End If
            Return MyBase.GetCellType(row)
        End Function
    End Class


Nadya | Tech Support Engineer
Telerik team
 answered on 16 Jan 2024
1 answer
31 views

Hello everyone, I have hidden the radApplicationMenuButton control. The hiding method is as shown in the figure above, but when I run the program, I find that the hidden control is still displayed. I want the ribbonTabFile control on the right to be displayed directly from the far left. , how should I set up, thank you!

Best regards,

Kevin

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 Aug 2023
1 answer
115 views

Hai,
   How to add icon or image on right side of the raddropdowlist  ?
   I am dynamically added dropdowlist via code and i need to add icon on right side of the control  (inside the control) ,In textbox i can add, like this i want to add icon, here i attach screenshot.

Thanks and Regards
Aravind

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 01 Aug 2023
1 answer
39 views

Hello everyone, I want to turn off the hidden function of the ribbonTab drop-down interface after double-clicking the mouse in Telerik's radRibbonBar control. How can I change it? I rewrote the double-click event of the ribbonTab and found that it has no effect. After double-clicking the ribbonTab, it will still be hidden. Thank you.


        private void radRibbonBar1_Load(object sender, EventArgs e)
        {
            foreach (var tab in radRibbonBar1.CommandTabs)
            {
                tab.DoubleClick += new EventHandler(ribbonTab_DoubleClick);
            }
        }

        private void ribbonTab_DoubleClick(object sender, EventArgs e)
        {
            // do nothing
        }

Dinko | Tech Support Engineer
Telerik team
 answered on 24 Jul 2023
1 answer
49 views

Hi,

When the Chinese input method is used, a Chinese word is generated after the space key is pressed. For example, if you enter j, i, a, n, c, h, a, and then press space, you will get "检查". I want to filter "检查" as a filter word. What should I do? Thanks.

Dinko | Tech Support Engineer
Telerik team
 answered on 12 Jul 2023
1 answer
49 views
In the 'RadCheckedDropDownList' control, when the AutoCompleteMode is set as SuggestAppend, it opens a dropdown with suggestions based on what was typed. Is there a way for me to make this suggestion dropdown not open and have the text appear in the normal dropdown instead? I don't find it very appealing to open two dropdowns when I could just use one. I didn't find any option to remove this suggestion dropdown.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Jun 2023
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
Buttons, RadioButton, CheckBox, etc
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
Menu
RichTextEditor
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
Tabstrip (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Barcode
Styling
ColorBox
PictureBox
Callout
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
CalculatorDropDown
Localization
TimePicker
ValidationProvider
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?