PC Review


Reply
Thread Tools Rate Thread

datagrid webcontrol in C#

 
 
=?Utf-8?B?SC4=?=
Guest
Posts: n/a
 
      26th Jun 2005
Hi,

I just have a simple question regarding dataGrid in ADO.NET. I developed the
web application by ASP.net and C#. I want to implment a dataGrid for the
product list. The product list display the product name, size, type, price
..... But for the specfic product category, its size column may not has any
data. So i want to write the code in back-end by C# to determin whether every
item in the size column in dataGrid has data. How I can write it in C# ?

is there methods I can use to determin every item in size column contains
data ?

Thank you,
H.
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      26th Jun 2005
H,

Every datagrid represents "data". When you have done that data in a
datatable. Than it is very easy to check if a item in a column has data

\\\
for (int i;i>dt.Table[x].Rows.Count;i++)
{if(dt.Table[x].Rows[i].MyColumn=="") {
//Do what you want to do}}
///
Written in this message so watch typos.

I hope this helps,

Cor


 
Reply With Quote
 
=?Utf-8?B?RWx0b24gVw==?=
Guest
Posts: n/a
 
      26th Jun 2005
You can have logic in datagrid_ItemDatabound event:

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
if (e.Item.Cells[size_index].Text.Equals(""))
{
// no size data
}
}


HTH

Elton Wang
(E-Mail Removed)


"H." wrote:

> Hi,
>
> I just have a simple question regarding dataGrid in ADO.NET. I developed the
> web application by ASP.net and C#. I want to implment a dataGrid for the
> product list. The product list display the product name, size, type, price
> .... But for the specfic product category, its size column may not has any
> data. So i want to write the code in back-end by C# to determin whether every
> item in the size column in dataGrid has data. How I can write it in C# ?
>
> is there methods I can use to determin every item in size column contains
> data ?
>
> Thank you,
> H.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid Webcontrol Magnus Microsoft C# .NET 1 5th Jun 2006 05:06 PM
PlaceHolder or Datagrid WebControl Sean Microsoft ASP .NET 0 9th Mar 2005 05:06 PM
How to get the DataSource of a DataGrid from my WebControl ? =?Utf-8?B?RGF2aWQgVw==?= Microsoft Dot NET 1 7th Feb 2005 09:49 AM
Reading the text in a datagrid webcontrol EMW Microsoft ASP .NET 1 20th May 2004 09:41 PM
table webcontrol vs datatable vs datagrid =?Utf-8?B?VGltIEsu?= Microsoft ASP .NET 0 20th May 2004 04:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:42 AM.