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
2320
Column Resizing Starred Columns Questions
posted

I have xamgrid where I set all columns width's to "*" (star)

Users can then re-size columns but it will let them resize until another column disappears.  Once that column disappears its gone until you restart the application. 

The only way I see to fix this is to add a minimum width to every column.

Two questions. 

Is that behavior (where column disappears and won't come back) a bug or expected?

Is there a way at the grid level, to set a default minimum width?  I see a MinimumRowHeight but no MinimumColWidth property?  Is there a place to set a default at the XamGrid level (I can't find it) so I can set it in one place per XamGrid?

Using version 10.2

Thanks in advance.

  • 6912
    Verified Answer
    posted

    Hi,

    An item was added to our backlog for the described use case.

    Meanwhile you can use the following snippet to set the MinimumWidth of the columns:

    // This is an event handler of the ColumnLayoutAssigned event of the XamGrid
    private void xamGrid_ColumnLayoutAssigned(object sender, ColumnLayoutAssignedEventArgs e)
    {
        this.Dispatcher.BeginInvoke(() =>
        {
            foreach (var column in e.ColumnLayout.Columns.DataColumns)
            {
                column.MinimumWidth = 20.0;
            }
        });
    }

    Regards,