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
885
Resize Child Row Columns When Parent is Expanded
posted

Hi - I have a WinGrid with two bands, master/detail relationship. When the the child band is revealed for a parent record, I want to resize the columns in the child rows based on visible data. I can do that in code no problem, but I can't find an event to use to fire the resize - I tried AfterRowExpanded on the parent row but it seems no data rows are visible at that time. I don't want to use AllRowsInBand because there are 40,000 of them and I am only showing five at a time.

It appears that when the code executes in the AfterRowExpanded that the rows either are not visible or do not contain data. I expand and columns are not resized. I fire the same code with a button when rows are visible and they resize correctly.

Any suggestions?

Parents
  • 1210
    Offline posted

    How do you access the child rows? This code seems to work as expected:

        Private Sub grd_AfterRowExpanded(sender As Object, e As Infragistics.Win.UltraWinGrid.RowEventArgs) Handles grd.AfterRowExpanded        

           Dim row As Infragistics.Win.UltraWinGrid.UltraGridRow

            If e.Row.HasChild Then            

                For Each row In e.Row.ChildBands(0).Rows                

                    row.Cells(0).Column.Width = 200            

                Next        

            End If    

    End Sub

     

Reply Children