GridViewComboBoxColumn selection change event handling issue

2 posts, 0 answers
  1. Chandra Sekhar
    Chandra Sekhar avatar
    16 posts
    Member since:
    Sep 2016

    Posted 30 Jan 2017 Link to this post

    Hi,

    I am using telerik library version 'UI for WinForms Q2 2014' and need to implement a selection change event for one of the GridViewComboBoxColumn type column. As per http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/how-to/howto-selectionchanged-comboboxcolumn I have to use the AddHandler method for which Telerik.Windows namespace has to be used, However for the version I am currently having doesn't contain any of these Telerik.Windows libraries. What is the best thing to do for me now to implement my feature.

     

    Thanks in advance.

    Chandra.

  2. Ralitsa
    Admin
    Ralitsa avatar
    192 posts

    Posted 31 Jan 2017 Link to this post

    Hi Chandra,

    Thank you for contacting us. 

    The referred link is from Telerik WPF`s documentation. Could you specify which product do you use: Telerik UI for WinForms or Telerik UI for WPF?

    If you use UI for WinForms, please refer to the code snippet below: 
    Private Sub radGridView1_CellEditorInitialized(sender As Object, e As GridViewCellEventArgs)
        Dim editor As RadDropDownListEditor = TryCast(e.ActiveEditor, RadDropDownListEditor)
     
        If editor IsNot Nothing Then
            Dim element As RadDropDownListEditorElement = TryCast(editor.EditorElement, RadDropDownListEditorElement)
            RemoveHandler element.SelectedIndexChanging, AddressOf element_SelectedIndexChanging
            AddHandler element.SelectedIndexChanging, AddressOf element_SelectedIndexChanging
     
            RemoveHandler element.SelectedIndexChanged, AddressOf element_SelectedIndexChanged
            AddHandler element.SelectedIndexChanged, AddressOf element_SelectedIndexChanged
        End If
    End Sub
     
    Private Sub element_SelectedIndexChanged(sender As Object, e As Telerik.WinControls.UI.Data.PositionChangedEventArgs)
        'to do something
    End Sub
     
    Private Sub element_SelectedIndexChanging(sender As Object, e As Telerik.WinControls.UI.Data.PositionChangingCancelEventArgs)
        'to do something
    End Sub

    I hope this will help. Do not hesitate to write back with further questions.

    Regards,
    Ralitsa
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top