I have FormView as master and couple RadGrids as detail and subdetail on my ASP.NET form. The relation between FormView-Grid-Grid works fine. If user clicks on a row in detail radGrid the subdetail radGrid shows filtered rows. I passing parameters to detail radGrid and subdetail radGrid as ControlParameters in SqlDataSource.
The issue is I cannot set an initial selection. I am using the code below. But when form is loaded still no selected rows in the detail radGrid. The subdetail radGrid shows nothing because SubID has not been passed to radGrid.
Oleg
<SelectParameters>
<asp:ControlParameter ControlID=
"cFormView"
Name=
"ID"
PropertyName=
"SelectedValue"
Type=
"Int32"
/>
<asp:ControlParameter ControlID=
"cFormView$radGridDetails"
DefaultValue=
"0"
Name=
"SubID"
PropertyName=
"SelectedValue"
Type=
"Int32"
/>
</SelectParameters>
The issue is I cannot set an initial selection. I am using the code below. But when form is loaded still no selected rows in the detail radGrid. The subdetail radGrid shows nothing because SubID has not been passed to radGrid.
protected
void
Page_PreRender(
object
sender, EventArgs e)
{
RadGrid rg = ((Telerik.Web.UI.RadGrid)(cFormView.FindControl(
"radGridDetails"
)));
if
(rg.SelectedIndexes.Count == 0)
{
rg.SelectedIndexes.Add(0);
}
}
Oleg