This is a migrated thread and some comments may be shown as answers.

Determining row number when user clicks a control

1 Answer 6 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 18 Nov 2013, 08:18 PM
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?

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 21 Nov 2013, 02:47 PM
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 >>
Tags
GridView
Asked by
Derek
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or