Hello there,
Is there any correct way for setting the width of a column, depending on the text length of the column header ?
I tried work arounds for this, but its not getting rite..
Sandeep
Did anyone find a could way to do this? I too would like to set column widths?
Could not find in online documentation
Thanks
Hello.
I found this posts in which they say they don't have auto-width for the columns depending on the content.
Only if the width of the columns it's specified e explicitly. Maybe they will help you.
http://forums.infragistics.com/forums/p/1077/47172.aspx#47172
http://forums.infragistics.com/forums/p/1077/11736.aspx#11736
Nico
Sandeep,
I suppose the grid creates all the fields equal in width to keep consistency in look. So you want the columns with the checkboxes to have smaller width. This would really depend on the "width" of the text and the checkbox element. I am sorry I cannot think of a good way of doing this except an estimate. If someone has a different approach in mind, he's welcome to share.
Alex.
Hello Alex,
The scenario goes like this.
The xamDataGrids put in all the screens will be having some standard columns.
for eg: Serial No or Record No.,
Check box columns like "Is Item Applicable", "Is Valid" etc etc...
Now i want to write a common function for setting standard width for these type of columns.
so when i handle a check box column like "Is Item Applicable" in my function, i want to calculate the width which will be required for it.
Hope its clear.
Hello Sandeep,
The length of the text is dependant on the FontSize of the text, so I am not sure how can this be calculated. Probably some near estimate has to be made for this.
Give us some more information on your scenario.