c# - Bind a gridview to a table with some logic built into the table? -
i have gridview , datatable. simple binding, right? want color code specific cells on gridview based on values of cells. know can on row databound event, means have logic on gui side. there way bind datatable table having info formatting gridview cell? ideally, i'd find way pass "value:color" combination each cell on binding, gridview pick color each cell.
can done?
from database
select case columnname when somevalue '<span style="background-color:red">' + columnname + '<\span>' else columnname end thecolumn
then in gridview itemtemplate
<asp:label text='<%#eval("thecolumn")%>' runat="server">
Comments
Post a Comment