Hi Teleriks Team,
I have a critical issue here. I have to show 2 details table on clicking 2 linkButton's in 2 RadGrid Columns respectively...
I tried :
But this is not working in my Scenario... The page Postbacks after linkbutton click event. And I have a GridBind and Rebind Events in ItemCommand EventHandler. So the above Code doesn't show up my detailsTable.
So is there any other way to get his working.. Please... do find my Code Snippets....
I request the team to help me in this issue.. Thanks in advance...
Raja..
I have a critical issue here. I have to show 2 details table on clicking 2 linkButton's in 2 RadGrid Columns respectively...
I tried :
<telerik:GridTemplateColumn> <ItemTemplate> <asp:LinkButtonID="LinkButton1"runat="server"Text="LinkButton"OnClick="HideDetail1_ShowDetail_Click">
</asp:LinkButton> </ItemTemplate></telerik:GridTemplateColumn>protectedvoidHideDetail1_ShowDetail_Click(objectsender, EventArgs e) { foreach(GridDataItem item inRadGrid1.MasterTableView.Items) { RadGrid1.MasterTableView.Items[item.ItemIndex].ChildItem.NestedTableViews[0].Visible = true; RadGrid1.MasterTableView.Items[item.ItemIndex].ChildItem.NestedTableViews[1].Visible = false; } }So is there any other way to get his working.. Please... do find my Code Snippets....
<telerik:RadGrid ID="RadGrid1" PagerStyle-Mode="NextPrevNumericAndAdvanced" Width="100%" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" PageSize="10" runat="server" PagerStyle-AlwaysVisible="true" OnDetailTableDataBind="RadGrid1_DetailTableDataBind" AllowPaging="True" AllowSorting="True" Visible="false" GridLines="None" AllowFilteringByColumn="true" Skin="Office2007" AutoGenerateColumns="False" OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound" ShowFooter="true"> <MasterTableView ShowFooter="true" AllowAutomaticUpdates="false" DataKeyNames="row_id, Agency_code, Agency" TableLayout="Fixed" CommandItemDisplay="TopAndBottom" HierarchyLoadMode="Client"> <DetailTables> <telerik:GridTableView CssClass="DetailTable" Name="RevenueNested" NoDetailRecordsText="No Records to display" ShowFooter="false" Width="1550px" AutoGenerateColumns="false" AllowFilteringByColumn="false" AllowPaging="false" AllowSorting="false" ToolTip="Click to View MOU\Payments"> <Columns> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Money_Collected" HeaderStyle-Width="100px" HeaderText="Money Collected" UniqueName="MoneyCollected"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Notes" HeaderStyle-Width="850px" HeaderText="Notes" UniqueName="Notes"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Modified_Date" HeaderStyle-Width="150px" HeaderText="Modified Date" UniqueName="ModifiedDate"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Modified_By" HeaderStyle-Width="100px" HeaderText="Modified By" UniqueName="ModifiedBy"> </telerik:GridBoundColumn> </Columns> </telerik:GridTableView> </DetailTables> <Columns><telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderStyle-Width="50px"> </telerik:GridEditCommandColumn> <telerik:GridBoundColumn HeaderStyle-Width="130px" DataField="Agency_code" ItemStyle-HorizontalAlign="Left" HeaderText="Agency Code" UniqueName="Agency_code"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn EditFormColumnIndex="1" FooterText="Total:" FooterStyle-HorizontalAlign="Right" AllowFiltering="true" UniqueName="agency" HeaderStyle-Width="300px" DataField="Agency" HeaderText="Agency"> <ItemTemplate> <asp:LinkButton ID="lnkViewMOU" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Agency")%>' OnClick="HideDetail1_ShowDetail_Click" ></asp:LinkButton> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-Width="180px" FooterStyle-HorizontalAlign="Right" DataField="Total_Billing_Amount" DataFormatString="{0:c}" ItemStyle-HorizontalAlign="Right" HeaderText="Billed/Estimated/MOU/Yearly Budget" UniqueName="Total_Billing_Amount"> </telerik:GridBoundColumn> <telerik:GridBoundColumn Aggregate="Sum" HeaderStyle-Width="130px" FooterStyle-HorizontalAlign="Right" DataField="MOU_Collected" DataFormatString="{0:c}" HeaderText="Money Collected" UniqueName="MOU_Collected" ItemStyle-HorizontalAlign="Right"> </telerik:GridBoundColumn> <telerik:GridBoundColumn Aggregate="Sum" DataField="Budget_Authoruty" FooterStyle-HorizontalAlign="Right" HeaderStyle-Width="130px" HeaderText="Budget Authority" DataFormatString ="{0:c}" UniqueName="Budget_Authoruty" ItemStyle-HorizontalAlign="Right"> </telerik:GridBoundColumn></Columns> <EditFormSettings> """""""""" """""""""" """""""""" """""""""" </EditFormSettings </MasterTableView> </telerik:RadGrid>---------------------------------------------------------------------protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { RadGrid1.Rebind(); } }protected void BindGrid() { """" """" """" }protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { DataTable dtlist = new DataTable(); GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; if (e.DetailTableView.Name == "RevenueNested") { int id= Convert.ToInt32(dataItem.GetDataKeyValue("id").ToString()); dtlist = obj.GetList(id); { e.DetailTableView.DataSource = dtlist; } } } protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { try { if (e.Item != null) { """"" """"" if (e.CommandName == "Update") { """"" """"" } if (e.CommandName == "Insert") { """"" """"" } } BindGrid(); RadGrid1.Rebind(); } Catch (Exception Ex) { } }protected void HideDetail1_ShowDetail_Click(object sender, EventArgs e) { foreach (GridDataItem item in RadGrid1.MasterTableView.Items) { RadGrid1.MasterTableView.Items[item.ItemIndex].ChildItem.NestedTableViews[0].Visible = true; } } }I request the team to help me in this issue.. Thanks in advance...
Raja..