or
var
oWnd = $find(
"<%=uxFilterRadWindow.ClientId %>"
);
oWnd.show();
<
asp:TemplateField
>
<
ItemTemplate
>
<
asp:GridView
ID
=
"secondLevelGrid"
runat
=
"server"
AutoGenerateColumns
=
"false"
CssClass
=
"ChildGrid" OnRowDataBound="secondLevelGrid_OnRowDataBound"
>
<
Columns
>
<%--My new nested grid goes here--%>
<
asp:BoundField
DataField
=
"Id"
HeaderText
=
"Id"
/>
<
asp:BoundField
DataField
=
"Code"
HeaderText
=
"Code"
/>
<
asp:BoundField
DataField
=
"Quantity"
HeaderText
=
"Q.ty"
/>
</
Columns
>
</
asp:GridView
>
</
ItemTemplate
>
</
asp:TemplateField
>
protected void firstLevelGrid_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridView firstLevelGrid = e.Row.NamingContainer as GridView;
string code = firstLevelGrid.DataKeys[e.Row.RowIndex].Value.ToString();
GridView secondLevelGridView = e.Row.FindControl("secondLevelGrid") as GridView;
secondLevelGridView.DataSource = //GetData
secondLevelGridView.DataBind();
}
}
<
telerik:RadGrid
ID
=
"grdLinee"
runat
=
"server"
AutoGenerateColumns
=
"false"
AllowAutomaticUpdates
=
"false"
AllowSorting
=
"true"
AllowPaging
=
"true"
PageSize
=
"10"
OnNeedDataSource
=
"grdLinee_NeedDataSource"
AllowAutomaticInserts
=
"true"
AllowAutomaticDeletes
=
"false"
OnItemCommand
=
"grdLinee_ItemCommand"
OnSelectedIndexChanged
=
"grdLinee_SelectedIndexChanged"
AllowFilteringByColumn
=
"false"
MasterTableView-EditMode
=
"InPlace"
ShowHeader
=
"true"
ShowFooter
=
"true"
ShowStatusBar
=
"true"
Skin
=
"Office2007"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
EnablePostBackOnRowClick
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"idCatalogoLinee"
CommandItemDisplay
=
"Top"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
></
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
Text
=
"Delete"
CommandName
=
"Delete"
ButtonType
=
"ImageButton"
ConfirmText
=
"Sei sicuro?"
/>
<
telerik:GridBinaryImageColumn
DataField
=
"immagine"
UniqueName
=
"immagine"
ResizeMode
=
"Fit"
DataType
=
"System.Byte"
></
telerik:GridBinaryImageColumn
>
//...
protected
void
grdLinee_ItemCommand(
object
sender, GridCommandEventArgs e)
{
switch
(e.CommandName)
{
case
"Update"
:
GridBinaryImageColumnEditor editor = (GridBinaryImageColumnEditor)item.EditManager.GetColumnEditor(
"immagine"
);
//editor.RadUploadControl.UploadedFiles.Count here is always 0
//...
}
}
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
Culture
=
"it-IT"
AllowPaging
=
"True"
AllowSorting
=
"True"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
>
<
ExportSettings
ExportOnlyData
=
"True"
>
<
Pdf
PageWidth
=
""
>
</
Pdf
>
</
ExportSettings
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
</
ClientSettings
>
<
MasterTableView
CommandItemDisplay
=
"Top"
DataKeyNames
=
"Code"
InsertItemPageIndexAction
=
"ShowItemOnCurrentPage"
>
<
CommandItemSettings
ShowExportToExcelButton
=
"True"
/>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
Text
=
"Delete"
CommandName
=
"Delete"
FilterControlAltText
=
"Filter column1 column"
ConfirmDialogType
=
"RadWindow"
ConfirmText
=
"Do you really want to delete this project and all its content?"
UniqueName
=
"Cancel"
>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridButtonColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
FilterControlAltText
=
"Filter EditCommandColumn1 column"
></
EditColumn
>
</
EditFormSettings
>
<
PagerStyle
AlwaysVisible
=
"True"
/>
</
MasterTableView
>
<
PagerStyle
AlwaysVisible
=
"True"
/>
</
telerik:RadGrid
>