0
Finally I got it to work thanks to a telerik old employee, who helped a lot
this is what he suggested, to replace the OnEditCommand for the following in the
Default.aspx
- OnItemCommand="RadGrid1_ItemCommand" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"
Default.aspx.cs (Code behind)
- protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
- {
- if (e.CommandName == RadGrid.SelectCommandName)
- {
- string sSelectedRowValue = "Primary key for the clicked item from ItemCommand: " + (e.Item as GridDataItem).GetDataKeyValue("logId").ToString();
- }
- }
- protected void RadGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
- {
- //- This gives me the row selected from the RadGrid
- Response.Write("Primary key for the clicked item from SelectedIndexChanged: "
- + (RadGrid1.SelectedItems[0] as GridDataItem).GetDataKeyValue("logId").ToString();
- }
Thank you all for all your help
0
Thanks Sagar for your reply, I have tried all sample from Telerik FAQ, Knowledge base etc.
and neither one help, all I want to accomplish is to select the primary Id items from the RadGrid and use it in another page that does not contain the RadGrid control, I was only able to make it to work using the Edit template and view the selected row within the same page that has the RadGrid control, but it is not what I am looking for.
I thought the Telerik RadGrid was more friendly, it appears to only works with its own template.
Thanks again.
0
Hi,
try below link :-
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Selecting/getting-cell-values-for-selected-rows
It might helps...