hi
I have a problem with the template field color, where the background color shold be black or white, depented of the value is 900 or else.
Anybody who can tell me how to do this in asp.net 2.0 with sqldatasource
I tried this code with no succes
Compiler Error Message: CS0119: 'System.Drawing.ColorTranslator' is a 'type', which is not valid in the given context
Source Error:
|
Line 186: <asp:TemplateField HeaderText="CaseNo" SortExpression="CaseNo">
Line 187:
Line 188: <ItemTemplate><asp:Label ID="Mylabel" runat= "server" Text='<%# Eval("CaseNo") %>' BackColor='<%# (Convert.ToBoolean(Eval("CaseNo").ToString().Equals("900")?System.Drawing.ColorTranslator("#000000"):System.Drawing.ColorTranslator("#FFFFFF"))) %> '/></ItemTemplate>
Line 189: <ItemStyle Font-Bold="True" ForeColor="#FF3300"></ItemStyle>
Line 190: |