
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DetailsViewDataBound.aspx.cs"
Inherits="DetailsViewDataBound" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css">
.changefont
{
font-weight: bold;
font-style: italic;
}
</style>
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DetailsView ID="ItemsDetailsView" runat="server"
AutoGenerateRows="true"
AllowPaging="true" DataKeyNames="ItemID"
DataSourceID="MyDataSource" AutoGenerateInsertButton="true"
OnDataBound="ItemsDetailsView_DataBound"
AutoGenerateEditButton="true">
</asp:DetailsView>
<br/>
<asp:label id="Message" forecolor="Red" runat="server"/>
<asp:SqlDataSource ID="MyDataSource"
ConnectionString="<%$Connectionstrings:ERPConnectionString%>"
SelectCommand="SELECT ItemID,ItemName,ItemType,ClStk FROM ItemTable"
runat="server" />
</div>
</form>
</body>
</html>
protected void ItemsDetailsView_DataBound(object sender, EventArgs e)
{
if (Convert.ToInt16(ItemsDetailsView.Rows[3].Cells[1].Text) <= 0)
{
ItemsDetailsView.Rows[3].Cells[1].CssClass = "changefont";
}
}
Copyright © 2012 - All Rights Reserved - VKInfotek.com