Change Templatecoloumn Layout

  • Thread starter Thread starter Kenneth Keeley
  • Start date Start date
K

Kenneth Keeley

Hi,
Can I change the layout and style of a TemplateColumn at run time to
display information differently base on one of the fields of data. If the
item is labled as urgent the title my appear Red instead of black, a Link
may take you to a different page depending on the type of item and so on.

Currently I use <%# DataBinder.Eval(Container.DataItem, "Title") %>
statements to display the data.

Thanks
Kenneth
 
Kenneth,

You should use ItemDataBound event in code-behind. It will be called for
every row. In the code you can check values of the cells and set styles or
visual properties.

Eliyahu
 
Back
Top