PDA

View Full Version : Repeater control


ebco
06-09-2003, 08:07 AM
I am using Repeater control to access datafrom database.

my data is showing me proplerly on this
<ItemTemplate>
<tr style="background-color:#ffecd8">
<td><%# DataBinder.Eval(Container.DataItem, "DBname") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "DBphone") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "DBtraining") %></td>
</tr>
</ItemTemplate>

But what if i want to check the field whether it is blank and if blank i want to put "-" in that cell.?

ReyN
06-09-2003, 11:07 AM
with templated controls, such as the Repeater, you have a choice of programmatically setting the content of the templates using either the ItemCreated or ItemDataBound events.

This example (http://aspalliance.com/aspxtreme/sys/web/ui/webcontrols/demos/DataGridItemDataBound.aspx) shows using both events to sum a column and set the totals in a footer with something like:

onItemDataBound="sumItems"
onItemCreated="setFooter"

though the example uses a DataGrid, the gist remains. :D

ebco
06-11-2003, 11:40 AM
Still I am facing the same problem but lot of other things I learn from given url

let me know if there any other link related to this