- <form id="form1" runat="server">
- <div>
- <asp:GridView ID="GridView1" runat="server" CellPadding="6" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound">
- <Columns>
- <asp:BoundField DataField="Id" HeaderText="Id"/>
- <asp:BoundField DataField="Name" HeaderText="Name"/>
- <asp:BoundField DataField="City" HeaderText="City"/>
- <asp:BoundField DataField="Salary" HeaderText="Salary"/>
- </Columns>
- </asp:GridView>
- </div>
- </form>
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
-
- if(e.Row.RowType==DataControlRowType.DataRow)
- {
-
- if(Convert.ToInt32(e.Row.Cells[3].Text)<10000)
- {
- e.Row.BackColor = Color.Cyan;
- }
- }
- }
No comments:
Post a Comment