RE: Applying a style to a bound column
- From: "Phillip Williams" <Phillip.Williams@xxxxxxxxxxxx>
- Date: Thu, 19 May 2005 11:28:15 -0700
Try using the ItemDataBound event instead. Your code might look like that:
Sub DataGrid1_Created(ByVal sender As Object, ByVal e As
DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
e.Item.CssClass = CType(e.Item.DataItem, DataRowView).Row("Selected")
End Sub
--
WEBSWAPP Development Inc.
http://www.webswapp.com
"UJ" wrote:
> How do you apply a css style to a bound column? I've tried the following
> code:
>
> <asp:BoundColumn DataField="CompanyName" SortExpression="CompanyName"
> HeaderText="Company" headerimageurl="../images/colcompany.gif" >
> <ItemStyle cssclass='<%# SelectCellStyle(Container.DataItem("Selected"))
> %>'></ItemStyle>
> </asp:BoundColumn>
>
>
> and get the error message BC30676: 'DataBinding' is not an event of
> 'System.Web.UI.WebControls.TableItemStyle'.
>
> So how do I apply the style to the bound column?
>
> TIA.
>
>
>
.
- References:
- Applying a style to a bound column
- From: UJ
- Applying a style to a bound column
- Prev by Date: datagrid linkbutton will not fire Postback at random times
- Next by Date: Putting an image in the footer of a datagrid.
- Previous by thread: Applying a style to a bound column
- Next by thread: DropDownList
- Index(es):