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
1825
Wingrid and Column outlook grouping ?
posted

I have a grid with a number of rows.

User drags one of the columns to the group area.

When I clikc on the "+" for the first group by that column in the grid I woul like to select the first row in that group.

How is that written in vb?

I have the following:

uwGrid_CallDetails.DisplayLayout.Bands(intBandCount).Layout.Rows(0).Selected = True

it then fails on the next line:

mskTxt_CI_TNID.Text = uwGrid_CallDetails.Selected.Rows(0).Cells("Service Number").Value

What am i missing/not understanding here?

thanks

Deasun

  • 469350
    Suggested Answer
    Offline posted

    Hi Deasun,

    The code you have here shows some confusion about the properties you are accessing.

    The Layout property on the band is a backward pointer to the grid's DisplayLayout which contains the band. So your code is kinda going in circles.

    grid.DisplayLayout and grid.DisplayLayout.Bands(x).Layout are the same thing.

    And grid.DisplayLayout.Bands(x).Layout.Rows is exactly the same as grid.Rows.

    Once you group the grid, the rows in the grid become a hierarchy. The first (root) level will contain GroupByRows and the second (child) level are data rows

    To get a child row from a GroupBy row, you would do something like this:


            Dim row As UltraGridRow
            Dim groupByRow As UltraGridGroupByRow

            row = Me.UltraGrid1.Rows(0)
            If row.IsGroupByRow Then
                groupByRow = CType(Me.UltraGrid1.Rows(0), UltraGridGroupByRow)
                Dim childrow As UltraGridRow
                childrow = groupByRow.Rows(0)
            End If