Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   How to hide a column in datagrid? (http://www.velocityreviews.com/forums/t170673-how-to-hide-a-column-in-datagrid.html)

ashtek@gmail.com 04-27-2006 08:12 AM

How to hide a column in datagrid?
 
Hi,

I am using a datagrid with databound columns. I want to set the width
of one of the columns to zero.
I use the following code in the design time.

<ASP:BOUNDCOLUMN DATAFIELD="FieldName" HEADERSTYLE-WIDTH="0"
ITEMSTYLE-WIDTH="0">
</ASP:BOUNDCOLUMN>

But the column still appears when the page loads showing me the data.

I do not want to use VISIBLE="False" because I want this column to be
generated in the client side so that I can access it using JavaScript.

Anyone has any clue?

Thanks in advance,
Ashish.


ashtek@gmail.com 04-27-2006 10:40 AM

Re: How to hide a column in datagrid?
 
This one works!!!!
Thank you Eliyahu :-)
I am still wondering why does the code HEADERSTYLE-WIDTH="0"
ITEMSTYLE-WIDTH="0" does not work?
Thank you,
Ashish.


Eliyahu Goldin 04-27-2006 10:41 AM

Re: How to hide a column in datagrid?
 
Ashish,

Use a css rule display:none.

Eliyahu

<ashtek@gmail.com> wrote in message
news:1146125578.119949.312790@v46g2000cwv.googlegr oups.com...
> Hi,
>
> I am using a datagrid with databound columns. I want to set the width
> of one of the columns to zero.
> I use the following code in the design time.
>
> <ASP:BOUNDCOLUMN DATAFIELD="FieldName" HEADERSTYLE-WIDTH="0"
> ITEMSTYLE-WIDTH="0">
> </ASP:BOUNDCOLUMN>
>
> But the column still appears when the page loads showing me the data.
>
> I do not want to use VISIBLE="False" because I want this column to be
> generated in the client side so that I can access it using JavaScript.
>
> Anyone has any clue?
>
> Thanks in advance,
> Ashish.
>




Eliyahu Goldin 04-27-2006 12:48 PM

Re: How to hide a column in datagrid?
 
Ashish,

Browsers have their own logic of setting column width. Your instructions are
actually only recommendations.

Eliyahu

<ashtek@gmail.com> wrote in message
news:1146134452.851402.39000@y43g2000cwc.googlegro ups.com...
> This one works!!!!
> Thank you Eliyahu :-)
> I am still wondering why does the code HEADERSTYLE-WIDTH="0"
> ITEMSTYLE-WIDTH="0" does not work?
> Thank you,
> Ashish.
>




=?Utf-8?B?U2VraGFy?= 04-27-2006 05:47 PM

RE: How to hide a column in datagrid?
 
hi
You dont have to set the column width to 0. Just uncheck the Visible
checkBox for the Column in the Columns Option of the Property Builder

Thanks
Sekhar


"ashtek@gmail.com" wrote:

> Hi,
>
> I am using a datagrid with databound columns. I want to set the width
> of one of the columns to zero.
> I use the following code in the design time.
>
> <ASP:BOUNDCOLUMN DATAFIELD="FieldName" HEADERSTYLE-WIDTH="0"
> ITEMSTYLE-WIDTH="0">
> </ASP:BOUNDCOLUMN>
>
> But the column still appears when the page loads showing me the data.
>
> I do not want to use VISIBLE="False" because I want this column to be
> generated in the client side so that I can access it using JavaScript.
>
> Anyone has any clue?
>
> Thanks in advance,
> Ashish.
>
>



All times are GMT. The time now is 04:43 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57