Hi,
I have binded the datas for WebHierarchialDataGrid and its child band through "Manual Load on demand" method.
Now, my problem is i couldn't enable the drop down provider for the child band while adding new row..
Could anyone provide me a sample for binding drop down provider for the child band ?
Hello tct_rani_1106,
Please let me know if you need further assistance on the matter.
Hi tct_rani_1106,
It has been some time since your post but in case that you still need assistance I will be happy to help.
Here is a sample markup needed to enable DropDownProviders for the child bands:
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" Height="350px"
Width="400px" AutoGenerateBands="False" AutoGenerateColumns="False" DataKeyFields="CustomerID"
DataMember="SqlDataSource1_DefaultView" DataSourceID="WebHierarchicalDataSource1"
Key="SqlDataSource1_DefaultView">
<Bands>
<ig:Band AutoGenerateColumns="False" DataKeyFields="OrderID" DataMember="SqlDataSource2_DefaultView"
Key="SqlDataSource2_DefaultView">
<Columns>
<ig:BoundDataField DataFieldName="OrderID" Key="OrderID">
<Header Text="OrderID" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="CustomerID" Key="CustomerID">
<Header Text="CustomerID" />
<ig:BoundDataField DataFieldName="ShipName" Key="ShipName">
<Header Text="ShipName" />
</Columns>
<Behaviors>
<ig:EditingCore>
<ig:RowAdding>
<ColumnSettings>
<ig:RowAddingColumnSetting ColumnKey="ShipName" EditorID="WebHierarchicalDataGrid1_DropDownProvider2" />
</ColumnSettings>
</ig:RowAdding>
<ig:CellEditing>
<ig:EditingColumnSetting ColumnKey="ShipName" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" />
</ig:CellEditing>
</Behaviors>
</ig:EditingCore>
</ig:Band>
</Bands>
<EditorProviders>
<ig:DropDownProvider ID="WebHierarchicalDataGrid1_DropDownProvider2">
<EditorControl DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False"
DataSourceID="SqlDataSource3" DataKeyFields="ShipName" TextField="ShipName">
<DropDownItemBinding TextField="ShipName"></DropDownItemBinding>
</EditorControl>
</ig:DropDownProvider>
<ig:DropDownProvider ID="WebHierarchicalDataGrid1_DropDownProvider1">
DataSourceID="SqlDataSource4" DataKeyFields="CompanyName" TextField="CompanyName">
<DropDownItemBinding TextField="CompanyName"></DropDownItemBinding>
</EditorProviders>
<ig:BoundDataField DataFieldName="CompanyName" Key="CompanyName">
<Header Text="CompanyName" />
<ig:BoundDataField DataFieldName="ContactName" Key="ContactName">
<Header Text="ContactName" />
<ig:RowAdding EnableInheritance="True">
<ig:RowAddingColumnSetting ColumnKey="CompanyName" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" />
</ig:WebHierarchicalDataGrid>
<ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server">
<DataViews>
<ig:DataView ID="SqlDataSource1_DefaultView" DataMember="DefaultView" DataSourceID="SqlDataSource1" />
<ig:DataView ID="SqlDataSource2_DefaultView" DataMember="DefaultView" DataSourceID="SqlDataSource2" />
</DataViews>
<DataRelations>
<ig:DataRelation ChildColumns="CustomerID" ChildDataViewID="SqlDataSource2_DefaultView"
ParentColumns="CustomerID" ParentDataViewID="SqlDataSource1_DefaultView" />
</DataRelations>
</ig:WebHierarchicalDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [OrderID], [CustomerID], [ShipName] FROM [Orders]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName] FROM [Customers]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT DISTINCT [ShipName] FROM [Orders]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT DISTINCT [CompanyName] FROM [Customers]"></asp:SqlDataSource>
Please find the attached complete sample.
Let me know if it helps.