3 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 15 Oct 2010, 10:16 AM
Hello Neil,
One option is using NestedViewTemplate for the grid to customizing the grid behavior. RadGrid gives you the ability to data bind the controls in a nested view template to a single item of a specified data source.
Demo
Documentation
-Shinu.
One option is using NestedViewTemplate for the grid to customizing the grid behavior. RadGrid gives you the ability to data bind the controls in a nested view template to a single item of a specified data source.
Demo
Documentation
-Shinu.
0

Neil
Top achievements
Rank 1
answered on 15 Oct 2010, 11:41 AM
Hi Shinu,
Thanks for the link and I've already saw the links that you provided.
But what I'm doing is a special case, to explain this:
1. The main radgrid is populated by data by using List<t> and i've no problem with that.
What I want to do is when I click the expand Iwant to get the value of a specific cell from the row where I click the expand
and then use it to search another List<T> and then using the result I will populate the expanded panel.
I will gladly appreciate if you could give me an example of code that when I clicked the expand it will return a value(Get a value from that row that I expand).
Thanks thanks thanks!
Thanks for the link and I've already saw the links that you provided.
But what I'm doing is a special case, to explain this:
1. The main radgrid is populated by data by using List<t> and i've no problem with that.
What I want to do is when I click the expand Iwant to get the value of a specific cell from the row where I click the expand
and then use it to search another List<T> and then using the result I will populate the expanded panel.
I will gladly appreciate if you could give me an example of code that when I clicked the expand it will return a value(Get a value from that row that I expand).
Thanks thanks thanks!
0
Hello Neil,
You can do it in two ways, both are demonstrated below.
You need to define DataKeyNames for the corresponding tableview in order to use this tableview's GetDataKeyValue method of the data items.
"Column1" is a column's UniqueName.
C#
Kind regards,
Dimo
the Telerik team
You can do it in two ways, both are demonstrated below.
You need to define DataKeyNames for the corresponding tableview in order to use this tableview's GetDataKeyValue method of the data items.
"Column1" is a column's UniqueName.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
OnNeedDataSource
=
"RadGrid_NeedDataSource"
OnItemCommand
=
"RadGrid1_ItemCommand"
>
<
MasterTableView
DataKeyNames
=
"Column1"
>
<
DetailTables
>
<
telerik:GridTableView
Width
=
"100%"
/>
</
DetailTables
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
br
/><
br
/>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text
=
" "
/>
C#
protected
void
RadGrid1_ItemCommand(
object
sender, GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.ExpandCollapseCommandName)
{
//Label1.Text = (e.Item as GridDataItem)["Column1"].Text;
Label1.Text = (e.Item
as
GridDataItem).GetDataKeyValue(
"Column1"
).ToString();
}
}
Kind regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items