Hi,
I am using igGrid MVC Helper and specifying columns explicitly.
Is there any way to adjust column width ??
At the moment its taking equal size for all columns and that is causing some column text to wrap. How can i control text wrap ??
You can mix auto generated columns and manually defined columns, but the manually defined columns will be generated first from left to right and then the auto generated columns.In order for this scenario to work you need to define defaultColumnWidth option of the grid. This option defines the width of all columns which don't have width defined, in our case the auto generated columns.Attached you can find sample which demonstrates this functionality.
Hope this helps,Martin PavlovInfragistics, Inc.
Thanks Martin for the update.
I have another doubt. If I have 100 columns in a grid and I am using MVC Helper, then how can I specify width and data formatting just for few columns ??
Its not feasible to explicitly define all columns just for specifying width and other formatting for few columns.
You can set column width by using the width option in JavaScript or Width() method in MVC.
Width can be set either in pixels or in percents as described in igGrid Columns and Layout topic.
In order to control cell text wrap you should use CSS rules.
For example if you want one line cells then you should use white-space: nowrap;
.ui-iggrid tbody td {
white-space: nowrap;
}
If you want fixed row height then you should use the following CSS:
display: block;
height: 40px; // set your desired row height
For the fixed row height you can use igGridTooltips feature.
Hope this helps,
Martin Pavlov
Infragistics, Inc.