I'm new to ASP.NET
I'm able to connect the WebHierarchicalDataGrid to my data source and the data shows up as expected.
Now, I'd like to center the data of a particular column.
I'm thinking I need to set a CSS value some place, right?
I found the ig_dataGrid.css file... and I don't know if this is where the change would be made.
Or, do I create my own file CSS file? or ?
Some help with understanding how this works would be greatly appreciated.
Thanks,
Brian.
Hello Brian,
You are correct – you can use CSS files to change not only the text alignment in the grid but also the entire grid appearance.
In your scenario you should set the CSS class for the needed columns or for the entire grid and put in it:
text-align: center;
In order to apply this style for the needed columns you should use selectors.
How you can apply different styles to the grid trough CSS you can read in this blog post - http://forums.infragistics.com/blogs/engineering/archive/2010/08/25/webdatagrid-css-styling-guide.aspx
Inform me if you need further assistance with this question.
Alex,
OK, now I see.
I added this to the ig_dataGrid.css file
tbody > tr > td.CenteredColumn
{
text-align:Center;
}
and then I went to the .aspx file and said which CssClass to use for that column.
<ig:BoundCheckBoxField CssClass="CenteredColumn" DataFieldName="Activated" Key="Activated">
That works like I wanted.
Thanks!