Hi Maz,
You cannot apply the css directly to the column in design view but what you
can do is use the ItemDataBound event of the DataGrid to set the cssclass
onto the button with code like this:
private void pricingRuleDataGrid_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType==ListItemType.Item
||e.Item.ItemType==ListItemType.AlternatingItem
||e.Item.ItemType==ListItemType.EditItem)
{
((WebControl)e.Item.Cells[4].Controls[0]).CssClass = "button1";
}
}
This of course assumes that the button is in the fifth column of the grid.
--
Steve Willcock (MCSD for Microsoft.NET)
http://www.willcockconsulting.com/
"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:Ik*************@news04.bloor.is.net.cable.rog ers.com...
Hi everyone,
Does anyone know how I can add a CSS (Ex. button1 ) to the following Edit
button is ASP .NET?
<asp:EditCommandColumn ButtonType="PushButton" EditText="Edit"
CancelText="Edit" UpdateText="Update"></asp:EditCommandColumn>
I want to change the way my buttons look.
Thank you
Maz.