Hi Saravanan,
You may change the negative quantity to N/A and color it in the
DataGrid.ItemDataBound. The following is a code snippet for demonstration.
You can modify it to meet your requirements.
private void DataGrid1_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item
||e.Item.ItemType==ListItemType.AlternatingItem)
{
Label l=new Label ();
l.Text ="N/A";
l.ForeColor =Color.Red;
if (Convert.ToInt32 (e.Item .Cells[3].Text)<0)e.Item
.Cells[3].Controls.Add(l);
}
}
Does this answer your question? Please let me know if you need more
information
Best regards,
Lewis
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Saravanan Rathinavelu" <
[email protected]>
| Sender: "Saravanan Rathinavelu" <
[email protected]>
| Subject: dynamically change
| Date: Wed, 20 Aug 2003 13:47:29 -0700
| Lines: 6
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcNnXEUjcshcGR3xT4afTQqucDH0SA==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridcontrol
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.datagridcontrol:6294
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridcontrol
|
| I need to know how to modify the <asp:BoundColumn/> to
| N/A when the datafield value comes in as negative
| quantity and color it different on the ASP.Net DataGrid,
| help me. thanks
|
| -Saravanan.R-
|