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
405
Alignment problem with child and parent band
posted

Hi,

I am using two bands in one grid. One band is parent band and another is child band of the parent band. Both are using same no of columns. Now the issue is when I expand any column then alignment of parent and child rows is not properly setting properly. I am using  OnAfterColPosChanged event for doing the re-alignment.

But the problem is my in child band first column's width should be less than the parent band first column, so that it looks like child.

 After OnAfterColPosChanged i need to set childband[colum1].width -= parentband[column1].width -20, but i am not able to do this in the end of this OnAfterColPosChanged().

plese tell me how set this width after OnAfterColPosChanged event.

pic  

 

protected override void OnAfterColPosChanged(AfterColPosChangedEventArgs e)

{

base.OnAfterColPosChanged(e);

if (DisplayLayout.Bands.Count == 0)

return;

UltraGridBand rootBand = DisplayLayout.Bands[0];

foreach (UltraGridBand band in DisplayLayout.Bands)

{

if (band.Key == DetailGridDataSource.ROOTGRIDNAME) continue;

// keep the column ordering in sync between both main and child bands

foreach (Infragistics.Win.UltraWinGrid.ColumnHeader header in e.ColumnHeaders)

{

if (header.Column.IsChaptered)

continue;

UltraGridColumn childBandColumn = band.Columns[header.Column.Key];if (e.PosChanged == PosChanged.Moved)

{

childBandColumn.Header.Fixed = header.Fixed;

childBandColumn.Header.SetVisiblePosition(header.VisiblePosition,
false);

}

if (e.PosChanged == PosChanged.Sized)

childBandColumn.Width = header.Column.Width;

if (e.PosChanged == PosChanged.HiddenStateChanged)

childBandColumn.Hidden = header.Column.Hidden;

}

}

}