JQuery:Highlight
GridView Negative value columns in ASP.NET
In C#:
using System.Data;
using System.Data.SqlClient;
public partial class NegativeGridRow : System.Web.UI.Page
{
protected
void Page_Load(object
sender, EventArgs e)
{
DataTable dt = new
DataTable();
dt.Columns.Add("Product Name");
dt.Columns.Add("Profit/Loss");
dt.Rows.Add("Monitor", "-999");
dt.Rows.Add("LCD", "200");
dt.Rows.Add("LED", "999");
dt.Rows.Add("Mouse", "-20");
dt.Rows.Add("Processor", "1000");
dt.Rows.Add("Wifi-Router", "-100");
dt.Rows.Add("Hard Drive", "100");
gvNegative.DataSource
= dt;
gvNegative.DataBind();
}
}
|
In VB.NET:
Imports System.Data
Imports System.Data.SqlClient
Partial Public Class NegativeGridRow
Inherits
System.Web.UI.Page
Protected
Sub Page_Load(ByVal
sender As Object,
ByVal e As EventArgs)
Dim dt As New DataTable()
dt.Columns.Add("Product Name")
dt.Columns.Add("Profit/Loss")
dt.Rows.Add("Monitor", "-999")
dt.Rows.Add("LCD", "200")
dt.Rows.Add("LED", "999")
dt.Rows.Add("Mouse", "-20")
dt.Rows.Add("Processor", "1000")
dt.Rows.Add("Wifi-Router", "-100")
dt.Rows.Add("Hard Drive", "100")
gvNegative.DataSource
= dt
gvNegative.DataBind()
End
Sub
End Class
|
output
No comments:
Post a Comment