Introduction:
Here I will explain
how to change gridview
column, row back color dynamically based on particular condition in asp.net using c#.
Description:
Now I will explain how to change gridview column background color dynamically based on particular condition in asp.net using c#.
Now I will explain how to change gridview column background color dynamically based on particular condition in asp.net using c#.
To change gridview column background color dynamically we need to write the
code like as shown below
# Code
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Convert
Gridview Columns as Rows in Asp.net</title>
<style type="text/css">
body
{
font-family:Calibri;
}
.gridcss
{
background:#df5015;
font-weight:bold;
color:White;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView ID="gvdata" runat="server" OnRowDataBound=gvdata_RowDataBound>
</asp:GridView>
</form>
</body>
</html>
|
Now in code behind
add the following namespace references
C# Code
|
After that write the
following code in code behind
|
Create custom gridview rows in .NET
ReplyDelete