Hello! I'm working with a RadGrid with HierarchyLoadMode="Client", in the second level of detailTables I have a GridTemplateColumn with a dropdownlist like this:
<
telerik:GridTemplateColumn
HeaderText
=
"Alta Petició"
HeaderStyle-HorizontalAlign
=
"Center"
UniqueName
=
"UNDDLAltaTop"
ItemStyle-HorizontalAlign
=
"left"
>
<
ItemTemplate
>
<
asp:DropDownList
ID
=
"DDLTP"
runat
=
"server"
OnSelectedIndexChanged
=
"DDLTP_SelectedIndexChanged"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
I'm set datasource of DDLTP in itemDataBound event:
if
(e.Item.OwnerTableView.Name ==
"Son"
)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
DropDownList ddl = (DropDownList)item[
"UNDDLAltaTop"
].FindControl(
"DDLTP"
);
setDatasource(
ref
ddl,
"ID_TP"
);
}
}
This works perfect!
Now I need to access to itemdata like (ItemCommand Event) to get the value of another column of the row
protected
void
DDLTP_SelectedIndexChanged(
object
sender, EventArgs e)
{
}
If I use an imagebutton to make the postback i can access itemData with ItemCommand Event but I don't like this solution:
<
telerik:GridTemplateColumn
HeaderText
=
"Alta Petició"
HeaderStyle-HorizontalAlign
=
"Center"
UniqueName
=
"UNDDLAltaTop"
ItemStyle-HorizontalAlign
=
"left"
>
<
ItemTemplate
>
<
asp:DropDownList
ID
=
"DDLTP"
runat
=
"server"
/>
<
asp:ImageButton
ID
=
"BAltaPeticio"
runat
=
"server"
CommandName
=
"Altapeticio"
ImageUrl
=
"../../Imatges/b_Add.gif"
ToolTip
=
"Alta Petició"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Can you help me??
thanks