| <telerik:RadGrid ID="RadGrid1" runat="server" |
| AllowPaging="True" GridLines="None" |
| AllowSorting="True" Skin="Office2007" AllowAutomaticUpdates="True" AutoGenerateColumns="False" |
| OnUpdateCommand="RadGrid1_UpdateCommand" OnNeedDataSource="RadGrid1_NeedDataSource" |
| OnItemCommand="RadGrid1_ItemCommand" OnItemCreated="RadGrid1_ItemCreated" OnPreRender="RadGrid1_PreRender"> |
| <PagerStyle Mode="NumericPages" /> |
| <MasterTableView AllowMultiColumnSorting="True" DataKeyNames="BillingItemID" > |
| <NestedViewTemplate> |
| <asp:Panel runat="server" ID="InnerContainer" Visible="false"> |
| <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false"> |
| <telerik:RadPageView runat="server" ID="PageView1"> |
| <asp:Label ID="BillingItemAssociationID" Text='<%# Eval("BillingItemAssociationID") %>' Visible="false" runat="server" /> |
| <telerik:RadGrid ID="ChildGrid" runat="server" OnNeedDataSource="ChildGrid_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCreated="RadGrid1_ItemCreated" AllowAutomaticUpdates="true" ShowFooter="true" AllowSorting="true"> |
| <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" DataKeyNames="BillingItemID" PageSize="10" HierarchyLoadMode="ServerOnDemand"> |
| <Columns> |
| protected void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| ((RadGrid)source).DataSource = BillingItemsChildData(id); |
| } |
I've set the OnNeedDataSource attribute in the nested grid but it's getting called at the right times! The only way I can get this to work is to use a SqlDatasource in the .aspx file and that's just not an option for me. Also You see i'm sending the id (datakey) to the
BillingItemsChildData method but i'm not able to get the datakey from the parent inside this event. I've been testing by manually setting it.
I've been stuck on this for a while now. People on here have suggested that I use the detailsgridbind event but it's not a details grid, it's a nested radgrid.
I've tried setting the NeedDataSource event programmaticaly in just about every event in the page lifecycle and nothing works, only the .aspx SqlDataSource.
Thanks in advance.