views:

116

answers:

1

Hi,

I need to change padding for one column in ASP.NET GridView, while all other CSS atributes defined in external CSS file should be left untouched. How can I do it?

Thanks in advance!

Update: Below is my code that solved the problem:

protected void gvwMaster_RowDataBound(object sender, GridViewRowEventArgs e)
{
    e.Row.Cells[0].Attributes.Add("style", "padding:0");
}
A: 

Hey,

You can tap into RowCommand event, which has e.Row.Cells, which you can change the styles for the cell (should have a styles collection or a CssClass property). I don't think each field (which translates to the column) has a CSS style setting...

Brian