Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
295
DropDownProvider in Adding New Row template of Child Band
posted

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 ?

 

 

  • 37874
    posted

    Hello tct_rani_1106,

    Please let me know if you need further assistance on the matter.

  • 37874
    Suggested Answer
    posted

    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>

                            <ig:BoundDataField DataFieldName="ShipName" Key="ShipName">

                                <Header Text="ShipName" />

                            </ig:BoundDataField>

                        </Columns>

                        <Behaviors>

                            <ig:EditingCore>

                                <Behaviors>

                                    <ig:RowAdding>

                                        <ColumnSettings>

                                            <ig:RowAddingColumnSetting ColumnKey="ShipName" EditorID="WebHierarchicalDataGrid1_DropDownProvider2" />

                                        </ColumnSettings>

                                    </ig:RowAdding>

                                    <ig:CellEditing>

                                        <ColumnSettings>

                                            <ig:EditingColumnSetting ColumnKey="ShipName" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" />

                                        </ColumnSettings>

                                    </ig:CellEditing>

                                </Behaviors>

                            </ig:EditingCore>

                        </Behaviors>

                    </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">

                        <EditorControl DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False"

                            DataSourceID="SqlDataSource4" DataKeyFields="CompanyName" TextField="CompanyName">

                            <DropDownItemBinding TextField="CompanyName"></DropDownItemBinding>

                        </EditorControl>

                    </ig:DropDownProvider>

                </EditorProviders>

                <Columns>

                    <ig:BoundDataField DataFieldName="CustomerID" Key="CustomerID">

                        <Header Text="CustomerID" />

                    </ig:BoundDataField>

                    <ig:BoundDataField DataFieldName="CompanyName" Key="CompanyName">

                        <Header Text="CompanyName" />

                    </ig:BoundDataField>

                    <ig:BoundDataField DataFieldName="ContactName" Key="ContactName">

                        <Header Text="ContactName" />

                    </ig:BoundDataField>

                </Columns>

                <Behaviors>

                    <ig:EditingCore>

                        <Behaviors>

                            <ig:RowAdding EnableInheritance="True">

                                <ColumnSettings>

                                    <ig:RowAddingColumnSetting ColumnKey="CompanyName" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" />

                                </ColumnSettings>

                            </ig:RowAdding>

                        </Behaviors>

                    </ig:EditingCore>

                </Behaviors>

            </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.

    WHDGDropDownProviders.zip