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
935
WHDG - Datasource binding issues
posted

Hi All,

I have a WHDG bound to a WebHierarchicalDataSource with a list of custom entities. The design on the grid is as follows:

                                                    <ig:WebHierarchicalDataGrid ID="uxDynamicContentsGrid" runat="server" Width="550px" Height="750px"

                                                        AutoGenerateBands="False" AutoGenerateColumns="False" EnableAJAX="false"

                                                        DataMember="DCDetails" Key="DCDetails" EnableDataViewState="false"

                                                        DataKeyFields="DynamicContentViewId"

                                                        GroupingSettings-ShowRemoveButton="False" StyleSetName="Office2007Silver"

                                                        GroupingSettings-GroupedRowTextMask="{1}" ShowHeader="False">

                                                        <EmptyRowsTemplate>There are no groups/ dynamic content assigned to the selected view.</EmptyRowsTemplate>

                                                        <GroupingSettings EnableColumnGrouping="True" GroupAreaVisibility="Hidden" ShowRemoveButton="False">

                                                            <RemoveButton AltText="Ungroup Column" />

                                                        </GroupingSettings>

                                                        <Behaviors>

                                                            <ig:Sorting Enabled="false"></ig:Sorting>

                                                            <ig:Activation>

                                                            </ig:Activation>

                                                            <ig:EditingCore AutoCRUD="False">

                                                                <Behaviors>

                                                                <ig:CellEditing>

                                                                        <ColumnSettings>

                                                                        <ig:EditingColumnSetting ColumnKey="DynamicContentName" ReadOnly="true" />

                                                                        </ColumnSettings>

                                                                    </ig:CellEditing>

                                                                    <ig:RowDeleting />

                                                                </Behaviors>

                                                            </ig:EditingCore>

                                                        </Behaviors>

The grid is bound on every postback (to resolve certain other issues we have). The loading of the grid is as follows:

        uxDynamicContentsGrid.Rows.Clear()

        uxDynamicContentsGrid.GroupingSettings.EnableColumnGrouping = DefaultableBoolean.False

        uxDynamicContentsGrid.GroupingSettings.GroupedColumns.Clear()

        uxDynamicContentsGrid.GroupingSettings.ColumnSettings.Clear()

        uxDynamicContentsSource.DataRelations.Clear()

        uxDynamicContentsSource.DataViews.Clear()

 

        uxDynamicContentsGrid.DataSource = Nothing

        uxDynamicContentsGrid.DataBind()

 

        Dim viewId As Integer = uxViewDropDown.SelectedValue

        If viewId > 0 Then

            contents = entityManager.GetContentsByEntityIdAndViewId(EntityId, viewId)

        Else

            contents = entityManager.GetContentsByEntityId(EntityId)

        End If

 

        ' Specify data views

        Dim dv As New Infragistics.Web.UI.DataSourceControls.DataView

        dv = New Infragistics.Web.UI.DataSourceControls.DataView

        dv.ID = "DCDetails"

        dv.DataSource = contents

 

        ' Add view to datasource

        uxDynamicContentsSource.DataViews.Add(dv)

 

        If viewId > 0 Then

            uxDynamicContentsGrid.GroupingSettings.EnableColumnGrouping = DefaultableBoolean.True

            ' A calculated property OrderedGroupName has been added which returns GroupOrder_ContentOrder_GroupName

            Dim setting As New GridControls.ColumnGroupingSetting

            setting.ColumnKey = "OrderedGroupName"

 

            setting.GroupComparer = New GroupNameComparer()

            uxDynamicContentsGrid.GroupingSettings.ColumnSettings.Add(setting)

            uxDynamicContentsGrid.GroupingSettings.GroupedColumns.Add("OrderedGroupName")

        End If

        uxDynamicContentsGrid.DataSource = uxDynamicContentsSource

        uxDynamicContentsGrid.DataBind()

THE ISSUE

1. When user selects an entity in WebDataTree, the details are populated in the grid (within a WebTab) with no grouping in a pre-defined order (as returned by the SQL query)

2. The user then selects a 'view' from a dropdown list and this reloads the grid based on the selection and groups the grid based on the value in a hidden column.

3. User selects another entity in the treeview. The details are populated in the grid correctly but the order is wrong. I have verified that the query retrieves the correct order. I have also verified that the contents of the DataView inside the WebHierarchicalDataSource is in the correct order. However, when DAtaBind is invoked and InitializeRow is called, it is done in an incorrect order.

I would appreciate it if someone could assist with this query as this is holding up our release.

Thanks!