M
Mick Walker
Hi everyone, I hope you all had a great weekend.
I have a problem, and I am really not sur eon how I should address it; I
have a repeater control, which is bound to a SqlDataSource, however
within the repeater control are a number of ImageButtons, and basically
if the Data Item is empty of NULL then I wish the image on the button to
be "cross.gif" otherwise I would like it to be "tick.gif".
As I said before I really have never came accross anything of the like
before, so I am totally stumped. Here is my current code:
<asp:Repeater ID="repItems" runat="server" DataSourceID="RepDS">
<HeaderTemplate ><table cellpadding="5" cellspacing="2" >
<tr class="TableCaptions">
<td><b>UID</b></td>
<td><b>Supplier SKU</b></td>
<td><b>Linked SKU</b></td>
<td><b>Name</b></td>
<td><b>SD</b></td>
<td><b>SKD</b></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="RowStyle">
<td align="left" valign="top"><asp:Label ID="lblName"
runat="server" /></td>
<td><asp:ImageButton ID="IBSupplierSKU"
runat="server" ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBLinkedSKU" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBName" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBShortDescription"
runat="server" ImageUrl="~/imgs/cross.gif" /></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr class="RowStyle">
<td align="left" valign="top"><asp:Label ID="lblName"
runat="server" /></td>
<td><asp:ImageButton ID="IBSupplierSKU" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBLinkedSKU" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBName" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBShortDescription" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBSKUDescription" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
</tr>
</AlternatingItemTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="repDS" runat="server" ConnectionString="<%$
ConnectionStringsBConn %>"
SelectCommand="SELECT [UID], [SupplierSKUCode], [LinkedSKU],
[Name], [ShortDescription], [SKUDescription] FROM [Import_Lines]">
</asp:SqlDataSource>
If anyone can help, i'll gladly buy you virtual beer for the rest of
your life.
Kind Regards
Mick
I have a problem, and I am really not sur eon how I should address it; I
have a repeater control, which is bound to a SqlDataSource, however
within the repeater control are a number of ImageButtons, and basically
if the Data Item is empty of NULL then I wish the image on the button to
be "cross.gif" otherwise I would like it to be "tick.gif".
As I said before I really have never came accross anything of the like
before, so I am totally stumped. Here is my current code:
<asp:Repeater ID="repItems" runat="server" DataSourceID="RepDS">
<HeaderTemplate ><table cellpadding="5" cellspacing="2" >
<tr class="TableCaptions">
<td><b>UID</b></td>
<td><b>Supplier SKU</b></td>
<td><b>Linked SKU</b></td>
<td><b>Name</b></td>
<td><b>SD</b></td>
<td><b>SKD</b></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="RowStyle">
<td align="left" valign="top"><asp:Label ID="lblName"
runat="server" /></td>
<td><asp:ImageButton ID="IBSupplierSKU"
runat="server" ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBLinkedSKU" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBName" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBShortDescription"
runat="server" ImageUrl="~/imgs/cross.gif" /></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr class="RowStyle">
<td align="left" valign="top"><asp:Label ID="lblName"
runat="server" /></td>
<td><asp:ImageButton ID="IBSupplierSKU" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBLinkedSKU" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBName" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBShortDescription" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
<td><asp:ImageButton ID="IBSKUDescription" runat="server"
ImageUrl="~/imgs/cross.gif" /></td>
</tr>
</AlternatingItemTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="repDS" runat="server" ConnectionString="<%$
ConnectionStringsBConn %>"
SelectCommand="SELECT [UID], [SupplierSKUCode], [LinkedSKU],
[Name], [ShortDescription], [SKUDescription] FROM [Import_Lines]">
</asp:SqlDataSource>
If anyone can help, i'll gladly buy you virtual beer for the rest of
your life.
Kind Regards
Mick