hi telerik,
I am using a radgrid, and i want to display all the column values to various text boxes and combo boxes while selecting a row from rad grid.
i am using a gridbutton column ( select ) to select the row.
can you tel me which is the fatest method to get the selected row vaules
and how ..? ( can you provide any example )
( if i dont want to use any javascript function )
expecting reply asap.
regards
kks
I am using a radgrid, and i want to display all the column values to various text boxes and combo boxes while selecting a row from rad grid.
i am using a gridbutton column ( select ) to select the row.
can you tel me which is the fatest method to get the selected row vaules
and how ..? ( can you provide any example )
( if i dont want to use any javascript function )
expecting reply asap.
regards
kks
4 Answers, 1 is accepted
0
Hello,
Additional information on a similar functionality is available in the following article. I hope it helps.
Best wishes,
Yavor
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Additional information on a similar functionality is available in the following article. I hope it helps.
Best wishes,
Yavor
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
kks
Top achievements
Rank 1
answered on 01 Jul 2008, 08:12 AM
thanks Yavor.
But my issue is i want to retrive all the column of selected row.
in the example which you mensioed above, will give only the column value which is assigned as datakeynames.
if my grid contain 30 column, i cant able to put all column names as DataKeyNames.
expecting your reply
But my issue is i want to retrive all the column of selected row.
in the example which you mensioed above, will give only the column value which is assigned as datakeynames.
if my grid contain 30 column, i cant able to put all column names as DataKeyNames.
expecting your reply
0
Shinu
Top achievements
Rank 2
answered on 01 Jul 2008, 09:21 AM
Hi Kks,
Try accessing the columns from the selected row using the UniqueName property of the Column in the SelectedIndexChanged event of the RadGrid as shown below.
CS:
Thanks
Shinu.
Try accessing the columns from the selected row using the UniqueName property of the Column in the SelectedIndexChanged event of the RadGrid as shown below.
CS:
protected void RadGrid2_SelectedIndexChanged(object sender, EventArgs e) |
{ |
foreach (GridDataItem item in RadGrid1.MasterTableView.Items) |
{ |
foreach(GridColumn col in RadGrid1.MasterTableView.RenderColumns ) |
{ |
if (item.Selected) |
{ |
string strtxt = item[col.UniqueName].Text.ToString(); |
} |
} |
} |
} |
Thanks
Shinu.
0
Mike
Top achievements
Rank 1
answered on 07 Jul 2008, 04:01 PM
This will get you the selected row which is great. Is there a way to get the row above and or below the selected row?
I am looking at what I was able to do with the GridView in ASP.NET and grab the index like this.
With that I was able to do another index and get the row above it by subtracting by 1
Is there a way I can do this with RadGrid?
I am looking at what I was able to do with the GridView in ASP.NET and grab the index like this.
GridView gv = (GridView)sender; |
int index = int.Parse(e.CommandArgument.ToString()); |
int Id = Convert.ToInt32(gv.DataKeys[index]["ID"]); |
With that I was able to do another index and get the row above it by subtracting by 1
int index2 = int.Parse(e.CommandArgument.ToString()) - 1; |
int Id2 = Convert.ToInt32(gv.DataKeys[index2]["ID"]); |
Is there a way I can do this with RadGrid?