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
60
XamGrid WPF: Columns chooser button disappears when column with is "*"
posted

Hi everyone.

When I set for columns the width equals star "*" and then hide all columns using "<<" button, I am not able to show them again, could you help e with that?

Parents
  • 34430
    Offline posted

    Hello Misha,

    I have been investigating into this behavior you are reporting, and I have reproduced it. This is unexpected behavior, and as such, I have asked our engineering staff to examine it a bit further. To ensure that it receives attention, I have logged this issue in our internal tracking systems with a development ID of 246517 and I have created you a private support case that I will link to this issue so that you can notified when a fix or other resolution becomes available. This support case has an ID of CAS-189099-Q2G8S1 and you can access it at https://www.infragistics.com/my-account/support-activity.

    As a workaround to this issue, I would recommend that you handle the ColumnVisibilityChanged event of the XamGrid. When the Visible column count gets to 1 or below, I would recommend setting the XamGrid.ColumnWidth to ColumnWidth.Auto as this should prevent this behavior from happening. Otherwise, you can set it back to ColumnWidth.Star. The code for this would look like the following:

    private void XamGrid_ColumnVisibilityChanged(object sender, Infragistics.Controls.Grids.ColumnVisibilityChangedEventArgs e)
    {
       XamGrid grid = sender as XamGrid;
       int count = grid.Columns.Where(c => c.Visibility == Visibility.Visible).ToList().Count;

       if(count == 1 || count == 0)
       {
         grid.ColumnWidth = ColumnWidth.Auto;
       }
       else
       {
          grid.ColumnWidth = ColumnWidth.Star;
       }
    }

    I hope this helps. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

Reply Children
No Data