473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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.

Apr 27 '06 #1
4 1503
Ashish,

Use a css rule display:none.

Eliyahu

<as****@gmail.com> wrote in message
news:11**********************@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.

Apr 27 '06 #2
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.

Apr 27 '06 #3
Ashish,

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

Eliyahu

<as****@gmail.com> wrote in message
news:11*********************@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.

Apr 27 '06 #4
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
"as****@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.

Apr 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Das | last post by:
Hi everyone, I'm using datagrid control to display the data. I want to hide column to be displayed into the data grid. I'm using the code as given below: Method given below is used to bind the...
2
by: Thanh Nu | last post by:
Hi, I would like to hide a column in a web datagrid (with create columns automatically at runtime checked), and I cannot refer to the columns collection like this: DataGrid1.Columns(0).Visible...
3
by: sivaraman.S | last post by:
Hi friends, How to hide a column in datagrid. regards, Sivaraman.S
5
by: J | last post by:
Ok, they have changed a lot of stuff in VB.net. How in the world do you hide a column on the Datagrid? -- Jason
1
by: nuhura01 | last post by:
Hi all.. I have a datagrid in my system and I preview the datagrid in other html page. Below are the code that I'm using: Dim oStringWriter As System.IO.StringWriter = New...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.