I have a GridView which is created dynamically at run-time (the code is in the .cs class).
The columns are added to the GridView by iterating through this code for all columns:
BoundField field = new BoundField();
field.HeaderText = element.Heading;
field.DataField = element.FieldName;
Column is added to the GridView.
TableGridView.Columns.Add(field);
I would like to add a padding-left style attribute to the first column. How exactly am I to do this through the C# code? As far as I know, I cannot do this by writing ASP.NET code since the columns are generated at run-time in the C# class.
Thanks!
Create a CSS class with the padding-left specified, then:
EDIT: Ok I added this to a code-behind:
..and this: