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
275
CellWidth can't be set to a low value
posted

The following code snippet is from the FieldLayoutInitialized handler of a XamDataGrid. Setting the CellWidth to 250 works fine (case "abc"), but setting it to 20 doesn't (case "def"), even if I am setting the CellMinWidth to the same value. It looks like the minimum width I can can set it to is around 60 (for this particular grid). Is there any other setting that prevents the CellWidth to go below a certain value?

            foreach (var field in e.FieldLayout.Fields)

            {

                switch (field.Name.ToLower())

                {

                    case "abc":

                        field.Settings.CellWidth = 250;

                        break;

                    default:

                        field.Settings.CellMinWidth = 20;

                        field.Settings.CellWidth = 20;

                        break;

                }

           }

 

Parents
No Data
Reply
  • 275
    Verified Answer
    Offline posted

    Answering my own question: It's the LabelWidth that was preventing the CellWidth to go below a certain value. Problem resolved by setting LabelWidth = CellWidth.

Children
No Data