-
datagrid
Is this possible. I'd like to place a field in my datagrid (bid_id) and make it visible=false. Then use that value to append data to a different field in the grid....like this..
Code:
<%# If Container.DataItem ("Bid_Id") = "44444" Then%>
<%# Container.DataItem ("Bid_Schedule_Desc")%>
<%else%>
<b>DELAYED</b>
<%# Container.DataItem ("Bid_Schedule_Desc")%>
<%end if%>
of course I'm getting an error...
-
From what I see of your code, you could turn of the auto generate columns in the datagrid and then use column templates.
Column templates look like:
Code:
<asp:datagrid id="QueueDataGrid" enableviewstate="true" runat="server" CssClass="Case_Data" AutoGenerateColumns="true" HeaderStyle-Font-Bold="True" ItemStyle-CssClass="Case_Data_Cell" onEditCommand="TakeCellClick">
<columns>
<asp:TemplateColumn runat="server" ItemStyle-CssClass="QueueButtonCell" >
<ItemTemplate>
<asp:button text="Take" CssClass="QueueButton" CommandName="Edit" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn runat="server" ItemStyle-CssClass="QueueButtonCell" >
<ItemTemplate>
<asp:label runat="server" text='<%# Databinder.Eval(Container.DataItem, "Request ID").ToString() %>' />
</ItemTemplate>
</asp:TemplateColumn>
</columns>
</asp:datagrid>
-
And, consider this:
<asp:label id="something" runat="server" text='
<%# IIf(Container.DataItem ("Bid_Id") = "44444", Container.DataItem ("Bid_Schedule_Desc"),
"<b>DELAYED</b>" & Container.DataItem ("Bid_Schedule_Desc")) %>' />
-
that gives me an error...
Expression Expected
-
There are no line breaks in the code I posted. The BBS inserted some, make sure you remove them.
-
thanks Rat, that worked....
Is there a way I can the IIF statement and add more clauses...
If = 1, then DELAYED
= 2 , then CANCELLED
= 3, then PRE_BID