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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -