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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top