All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
"server"
AutoGenerateColumns
"false"
OnNeedDataSource
"RadGrid1_NeedDataSource"
OnItemDataBound
"RadGrid1_ItemDataBound"
>
MasterTableView
CommandItemDisplay
"Top"
DataKeyNames
"ID"
EditMode
"EditForms"
Columns
telerik:GridBoundColumn
DataField
UniqueName
HeaderText
</
"Name"
telerik:GridEditCommandColumn
EditFormSettings
EditFormType
"Template"
FormTemplate
"RadGrid2"
"RadGrid2_NeedDataSource"
OnUpdateCommand
"RadGrid2_UpdateCommand"
protected
void
RadGrid1_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
dynamic data1 =
new
[] {
{ ID = 1, Name =
"Name_1"
,FileName =
"jayesh-Softweb.jpg"
},
{ ID = 2, Name =
"Name_2"
{ ID = 3, Name =
"Name_3"
{ ID = 4, Name =
"Name_4"
{ ID = 5, Name =
"Name_5"
}
};
RadGrid1.DataSource = data1;
RadGrid1_ItemDataBound(
sender, GridItemEventArgs e)
if
(e.Item.IsInEditMode && e.Item
is
GridEditFormItem)
GridEditFormItem item = e.Item
as
GridEditFormItem;
RadGrid RadGrid2 = item.FindControl(
)
RadGrid;
RadGrid2_UpdateCommand(
sender, GridCommandEventArgs e)
RadGrid2_NeedDataSource(
RadGrid RadGrid2 = (sender
RadGrid);
GridEditableItem item = (RadGrid2.NamingContainer
GridEditFormItem);
string
strKey = item.GetDataKeyValue(
).ToString();
{ ID = 1, Name =DateTime.Now.ToString(),FileName =
RadGrid2.DataSource = data1;
Good morning,
please, how can I make a link between radgrid1 and radgrid 2, I need to link the sqldatasource for radgrid2 by the key of radgrid1