Determining row number when user clicks a control

2 posts, 0 answers
  1. Derek
    Derek avatar
    2 posts
    Member since:
    Oct 2013

    Posted 18 Nov 2013 Link to this post

    Hi,
    I've spent some time reviewing the threads and api and have not been able to figure out how to determine which row a user clicked on when they selected a control on the grid.

    Because the control is within the cell, when the user selects a combobox for example, the row itself is not selected making it difficult to find out what row they are manipulating.  Ultimately, I would like to disable certain cells within the row of the combobox the user changed the value to.

    Can you help?
  2. Yoan
    Admin
    Yoan avatar
    1068 posts

    Posted 21 Nov 2013 Link to this post

    Hi Derek,

    As I understand you have define your ComboBox in GridViewColumn's CellTemplate. In this way the selection logic of RadGridView is not executed, since the combobox handles the mouse/keyboard events. Please consider to use CellEditTemplate instead. However, you can find the row by subscribing to combobox's event and execute the following code:
    GridViewRow row = ((Combobox)sender).ParentOfType<GridViewRow>();
        if (row != null)
         {
        // your code
         }

    I hope this helps.

    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top