We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

grid row selection

I would like to extract the data from certain columns in a row of data when it is selected. The thing I don''t know is what syntax to use. What event is triggered when a row is selected and what arguments item do I use?

Thanks,
Sandy

4 Replies

AD Administrator Syncfusion Team July 22, 2006 01:58 AM UTC

Hi Sandy,

To do this, You should handle the ''SelectedRecordsChanged'' event and also set the ''PostBackOnFocusedChanged'' property to ''True''. This property ''PostBackOnFocusedChanged'' makes the grid to trigger a postback whenever a selection is changed and the event ''SelectedRecordsChanged'' triggers whenever the selection is made and the grid gets posted back.

To Get the value of any of the fields in the selected row try something similar to the code below inside the ''SelectedRecordsChanged'' event.

[c#]
if(e.SelectedRecord!=null)
{
e.SelectedRecord.Record.GetValue("ColumnName");
}

[vb]
If (Not e.SelectedRecord Is Nothing) Then
e.SelectedRecord.Record.GetValue("ColumnName")
End If

Hope this helps.

Thanks,
A.Sivakumar


AD Administrator Syncfusion Team July 22, 2006 02:00 PM UTC

That worked great. I had tried the SelectedRowChanged event previously but was missing the PostBackOnFocusChanged = true part.
Thanks Again!
Sandy


MA Mike at MK March 7, 2008 09:04 PM UTC

I tried this too and it did work, but the only problem I am having, the row selection is executing every time my page does any postback. In otherwords, if I click another control, it forces a postback and the grid selects a row on its own causing it to execute code I don't want run until I actually click on a row.

>I would like to extract the data from certain columns in a row of data when it is selected. The thing I don't know is what syntax to use. What event is triggered when a row is selected and what arguments item do I use?

Thanks,
Sandy



AD Administrator Syncfusion Team March 11, 2008 04:36 AM UTC

Hi Sandy,

Thank you for your Patience.

Issue : the row selection is executing every time my page does any postback

The issue mentioned here is suspected to be a defect and we have sent this to our development team for more analysis. We will update you once we get back from our development team.

Please let me know if you have any other concerns.

Regards,
Vishnu.



Loader.
Live Chat Icon For mobile
Up arrow icon