How to hide a column in datagrid?

A

ashtek

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.
 
A

ashtek

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.
 
E

Eliyahu Goldin

Ashish,

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

Eliyahu
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top