Dynamically Generated Columns needs to hidden

S

source

I need to hide one column which I bind to my datagrid using a dataset. I
know I can take the column out of my SQL for my dataset, but I cannot I need
that column in my dataset but dont want that column in my datagrid.

Bottom line ...... How can I hide auto generated columns ??????
programmatically ???
 
M

Micharel Tkachev

You can use the property Visible.
For example:

dgd.Columns[5].Visible = false;
 
S

source

visible property only works for explicitlly added columns. I tried using
this for automatically generated columns but it doesn't work.


Micharel Tkachev said:
You can use the property Visible.
For example:

dgd.Columns[5].Visible = false;

--
The Best Regards,
.Net Developer
Michael Tkachev
(e-mail address removed)

source said:
I need to hide one column which I bind to my datagrid using a dataset. I
know I can take the column out of my SQL for my dataset, but I cannot I need
that column in my dataset but dont want that column in my datagrid.

Bottom line ...... How can I hide auto generated columns ??????
programmatically ???
 
R

Renee Kraft

You can't hide autogenerated columns but you can remove columns from the
dataset :)

Here's how I "hide" the column Total in my BindData function:

ds = new DataSet()
sda.Fill(ds, "ProjectsTools")
ds.Tables("ProjectsTools").Columns.remove("Total")
mdgProjectsTools.DataSource=ds.Tables("ProjectsTools").DefaultView
mdgProjectsTools.DataBind()

=======================
Renee Kraft
E-mail: (e-mail address removed)
--Remove ns from address--
=======================


source said:
visible property only works for explicitlly added columns. I tried using
this for automatically generated columns but it doesn't work.


Micharel Tkachev said:
You can use the property Visible.
For example:

dgd.Columns[5].Visible = false;

--
The Best Regards,
.Net Developer
Michael Tkachev
(e-mail address removed)

source said:
I need to hide one column which I bind to my datagrid using a dataset. I
know I can take the column out of my SQL for my dataset, but I cannot
I
need
that column in my dataset but dont want that column in my datagrid.

Bottom line ...... How can I hide auto generated columns ??????
programmatically ???
 

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,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top