Hi,
I am using WebDataGrid 11.2
I am binding a dataset to a grid. One of the column values may grow to to large size. Currently, the grid automatically truncates the data to keep the row height/column width constant.
Is it possible to make the cell grow (vertical growth preferred) to accomodate the complete data?
Markup of grid:
<ig:WebDataGrid
ID="WebDataGrid1"
runat="server"
Height="100%"
Width="100%"
DefaultColumnWidth="150px"
Font-Size="Small"
AutoGenerateColumns="true">
<Behaviors>
<ig:Selection></ig:Selection>
<ig:Sorting></ig:Sorting>
</Behaviors>
</ig:WebDataGrid>
Thanks
Sharon.
Hi Sharon,
Thank you for posting in the community.
In order to autosize the column width of your grid based on cell width, you can set the ItemCssClass of WebDataGrid. For instance:
tbody.AutosizeCells>tr>td{ background-color:White; border-top:solid 1px #D8D8D8; padding:5px 8px 5px 8px; height: 20px; text-align:left; vertical-align:middle; white-space:nowrap; overflow: visible;}
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="358px" ItemCssClass="AutosizeCells"/>
Note that in order for this to work, the width of your columns should not be set explicitly.
You may find additional useful information for styling WebDataGrid at:
http://forums.infragistics.com/blogs/engineering/archive/2010/08/25/webdatagrid-css-styling-guide.aspx
Please let me know if this helps.
Please do not hesitate to contact me if you have any questions.
Hello JKL,
Thank you for your reply and for sharing your solution !
Please do not hesitate to contact me if any additional questions regarding this matter arise.
Hi Petar.
I have the same problem.
I already tried using the CSS ane the nowrap is working, but the column width is not changing. My webdatagrid is:
<ig:WebDataGrid ID="DownloadGrid" runat="server" CssClass="DownloadGrid" ClientIDMode="Static" ItemCssClass="DownloadGrid" >
Removing CssClass or ItemCssClass makes no change.
The columns width is not set, nor the DefaultColumnWidth.
Any suggestions?
Thanks.
EDIT--------
Found the problem.
Autoresize doesn't work because there was a width on a radio button:
<Columns><ig:TemplateDataField Key="RADIO" Width="10px" CssClass="igg_TextAlignCenter"><ItemTemplate> <asp:RadioButton ID="rdbRadio" runat="server" GroupName="RezTbl" /></ItemTemplate></ig:TemplateDataField></Columns>
Removed that and it works.