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
1180
e.CurrentSelectedRows.Count = 0 inside SelectionChanged when selection goes from child band to parent band ?
posted

There are two bands, parent and child, playing with row selection.
When changing selection between rows in same band, everything is ok, e.CurrentSelectedRows contains proper rows, selection event is triggered once per selection change.
When child row is selected, event is triggered once per band - i can live with that, checking Level property for sender (another thing to be included into manual ;)

Problem : when row from child band is selected and we click on parent row, event is triggered only for ContainerGrid on level1, and e.CurrentSelectedRows contains 0 rows. No info on selection in band0. Next selections on band0 will have PreviousSelectedRows fileld properly with band0 row.

How can I detect selection change in such a situation (click from child to parent)?

Grid:

<ig1:WebHierarchicalDataGrid ID="m_gridKlasy" runat="server" Height="350px" Width="900px"
    AutoGenerateBands="False" AutoGenerateColumns="False" DataKeyFields="ID" DataMember="ObjectDataSourceKlasy_DefaultView"
    DataSourceID="KlasyDataSource" Key="ObjectDataSourceKlasy_DefaultView" OnRowSelectionChanged="m_gridKlasy_RowSelectionChanged">
    <Bands>
        <ig1:Band AutoGenerateColumns="False" DataMember="ObjectDataSourceDaneKlas_DefaultView"
            Key="ObjectDataSourceDaneKlas_DefaultView" DataKeyFields="Id">
            <Columns>
               //...
            </Columns>
        </ig1:Band>
    </Bands>
    <Columns>
     //...
    </Columns>
    <Behaviors>
        <ig1:EditingCore EnableInheritance="True">
            <Behaviors>
                <ig1:CellEditing EnableInheritance="True">
                </ig1:CellEditing>
            </Behaviors>
        </ig1:EditingCore>
        <ig1:RowSelectors>
        </ig1:RowSelectors>
        <ig1:Paging>
        </ig1:Paging>
        <ig1:Sorting>
        </ig1:Sorting>
        <ig1:Selection CellClickAction="Row" RowSelectType="Single" EnableHiddenSelection="True">
            <AutoPostBackFlags RowSelectionChanged="True" />
        </ig1:Selection>
    </Behaviors>
    <Templates>
    </Templates>
    <EmptyRowsTemplate>
        No data
    </EmptyRowsTemplate>
</ig1:WebHierarchicalDataGrid>