Developer forum

Forum » Development » dw:EditableGrid control

dw:EditableGrid control


Reply

I'm using dw:EditableGrid control but i have a doubt!!
Can I change the row background color, based on a cell value?

Example: if the product price is below 7 the row background color will change to red

 

Name

Description

Price

Product1

description

5

Product2

description

10

Product3

description

6

Product4

description

9

 


Replies

 
Reply
Hi,

<dw:EditableGrid ID="products" runat="server" EnableViewState="true" OnRowDataBound="products_OnRowDataBound"></dw:EditableGrid>

and

Protected Sub products_OnRowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles products.RowDataBound
            If Not e.Row.RowType = DataControlRowType.DataRow OrElse IsNothing(e.Row.DataItem) Then
                Exit Sub
            End If

            Dim p As Product = CType(e.Row.DataItem, Product)

            If p.Price.Price < 7 Then
                e.Row.BackColor = Color.Red
            End If
End sub


 

You must be logged in to post in the forum