However, what I want is when a row in the mastertable is selected, and the edit putton is clicked, the detailtable has to expand and has to be put in edit mode. I can't get this done. This is what I have:
protected void button_Click(object sender, EventArgs e) {
bool isInEditMode = false;
foreach (GridItem item in rg.MasterTableView.Items) {
if (item.Selected){
if (item is GridEditableItem){
((GridEditableItem) item).Edit = true;
isInEditMode = true;
}
if (item is GridDataItem){
GridTableView nestedView = ((GridDataItem)item).ChildItem.NestedTableViews[0];
if (tmp.Name == "Pricing"){
item.Expanded = true;
item.Edit = true;
}
}
item.Selected = false;
}
}
if (isInEditMode) {
// disable selecting because we're in edit mode
rg.ClientSettings.Selecting.AllowRowSelect = false;
rg.Rebind();
}
}
if (isInEditMode) {
// disable selecting because we're in edit mode
rg.ClientSettings.Selecting.AllowRowSelect = false;
rg.Rebind();
<Philips:MagAgRadGrid ID="rg" runat="server" AllowSorting="True" OnNeedDataSource="rg_NeedDataSource" AllowMultiRowEdit="True" OnItemCommand="rg_ItemCommand" Skin="Outlook" AllowMultiRowSelection="True" EnableOutsideScripts="True" EnableViewState="true" OnDetailTableDataBind="rg_DetailTableDataBind" >
..........
..........
<DetailTables>
<radG:GridTableView DataKeyNames="MarketProductID" Name="Pricing" Width="100%" AutoGenerateColumns="false" >
<ParentTableRelation>
<radG:GridRelationFields DetailKeyField="MarketProductID" MasterKeyField="MarketProductID" />
</ParentTableRelation>
<Columns>
<radG:GridBoundColumn SortExpression="Country" HeaderText="Country" DataField="Name"></radG:GridBoundColumn>
<radG:GridTemplateColumn HeaderText="AVNP" UniqueName="AVNP" SortExpression="AVNP">
<ItemStyle VerticalAlign="Top" HorizontalAlign="Center" />
<ItemTemplate>
<asp:Label ID="lblAVNP" runat="server" Text='<%# Eval("AVNP") == DBNull.Value ? " 0.00" : Convert.ToDouble(Eval("AVNP")).ToString(" #0.00") %>' ></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<radG:RadNumericTextBox ID="txtAVNP" runat="server" MinValue="0" EnabledStyle-HorizontalAlign="Right" Skin="Outlook" Value='<%# Eval("AVNP") %>' Width="60px">
<NumberFormat DecimalDigits="2" GroupSeparator="" />
</radG:RadNumericTextBox>
</EditItemTemplate>
</radG:GridTemplateColumn>
</Columns>
</radG:GridTableView>
</DetailTables>
..........
..........
I hope anybody can help me.