How do you set the default WebDataGrid row height? The default seems to be 31 pixels. (See attached image.)
The code below doesn't work. It gets called, but the row height doesn't change unless you use a number greater than 31.
protected void WebDataGrid1_InitializeRow(object sender, RowEventArgs e){ e.Row.Height = Unit.Pixel(20);}
Hello raywhite,
I have been looking into your questions and I believe that th3e issue that you are describing is caused because in our styles we set padding for the cells and their height. Therefore I can suggest you modify the following style: tbody.igg_Item>tr>td in the file ig_res\Default\ig_dataGrid.css by decreasing the following three properties based on your requirements:
height: 5px;
line-height: 5px;
padding:5px 8px 5px 8px;
If you need any additional assistance on the matter please do not hesitate to ask.
I was just wondering did you have a chance to try my suggestion. If you still need any assistance on the matter, please do not hesitate to ask.
Yes, I tried it and it worked. But I did not like the solution. It seems like a hack, plus... when I copy your "shipping" styles to my folder again, I won't remember that I had hacked my own. I'll have to remember to hack them again each time I get your latest styles. I'd prefer to override just the row height and keep all your other styles intact.
Hello raywhite ,
I can see your concerns therefore I can suggest you just change the design by creating a new style for the cells as follows:
tbody.thinRows > tr > td
{
line-height: 3px;
padding: 1px 1px 1px 1px;
}
and assign it to the WebDataGrid:
<ig:WebDataGrid id="wdg1" runat="server" ItemCssClass="thinRows"
For additional reference on styling WebDataGrid you can check the following blog :
http://www.infragistics.com/community/blogs/engineering/archive/2010/08/25/webdatagrid-css-styling-guide.aspx
Perfect! That works for me!