For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > July 2006 > Help with DataGrid









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help with DataGrid
dotnetbuddy

2006-07-03, 7:04 pm

Hi,
Iam using VS 2003 for development. In ItemDataBound event of a
datagrid I want to know whether a particular column is being displayed
or not. Depending on certain criteria Iam hiding columns in Page_Load
like
grdMyGridColumns[4].Visible =false;
grdMyGridColumns[6].Visible =false;

Then during runtime Iam doing some bussiness logic in ItemDataBound,
I need to know whether a particular column is visible or not.
I tried the following but of no use:
e.Item.Cells[4].Visible, because it is returning true
irrespective of whether the column is being displayed or not.

Thanking you in advance.

ReyN

2006-07-03, 7:04 pm


just curious

if you're checking for column visibility, why not just use

if ( myGrid.Columns[4].Visible )

____________________

Reynald V. Nu=F1ez
http://authors.aspalliance.com/aspxtreme

dotnetbuddy

2006-07-03, 7:04 pm

Thanks ReyN, it works. Thanks for your prompt reply.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com