473,320 Members | 2,189 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 column in autogenerated DataGRID ?!?!?!

jax
Hi All developers !

I have a datagrid which autogenerates columns by the
sql SELECT list... The list (for some reasons) must be the
same. So my question is

HOW TO MOVE OUT A COLUMN
FROM AUTOGENERATED DATAGRID?

I would really appreciated answer with some code ! :))

THANK YOU ALL !!!
Nov 18 '05 #1
2 2396
Here's a good article that addresses your question:

http://www.c-sharpcorner.com/Code/20...ridColDyna.asp
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"jax" <su********@yahoo.com> wrote in message
news:c4**********@bagan.srce.hr...
Hi All developers !

I have a datagrid which autogenerates columns by the
sql SELECT list... The list (for some reasons) must be the
same. So my question is

HOW TO MOVE OUT A COLUMN
FROM AUTOGENERATED DATAGRID?

I would really appreciated answer with some code ! :))

THANK YOU ALL !!!

Nov 18 '05 #2
One way is to make that column invisible at ItemDataBound of the datagrid, like this (vb syntax)

Private Sub grdTest_ItemDataBound(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
Handles grdTest.ItemDataBoun

e.Item.Cells(MyColumnIndex).Visible = Fals

End Su

If you were not autogenerating the columns, you could use .findcontrol to get the id, but I don't think you can set the id for autogenerated

hth

Bil

----- jax wrote: ----

Hi All developers

I have a datagrid which autogenerates columns by th
sql SELECT list... The list (for some reasons) must be th
same. So my question i

HOW TO MOVE OUT A COLUM
FROM AUTOGENERATED DATAGRID

I would really appreciated answer with some code ! :)

THANK YOU ALL !!

Nov 18 '05 #3

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...
3
by: McNutt Consulting | last post by:
I'm trying to implement a datagrid with dynamically created columns. The data is coming out of a very simple XML file, and it's bound through a dataview. The datagrid is just a shell definition...
2
by: jax | last post by:
Hi All developers ! I have a datagrid which autogenerates columns by the sql SELECT list... The list (for some reasons) must be the same. So my question is HOW TO MOVE OUT A COLUMN FROM...
8
by: Hanson | last post by:
I have a datagrid control in an aspx page. The datagrid columns will be dynamically generated according to the pre-page's search condition, I want to hide some columns in the datagrid. is that...
7
by: ruca | last post by:
Hi, I want to set visible to false in my datagrid to all fields that are an ID. How can I do this? I'm using ItemDataBound event but it gives me an error: "Index was out of range. Must be...
7
by: Rob | last post by:
Does anyone know how I could hide a column in a DataGrid? To make the problem harder I am using AutoGenerateColumns="True" so I don't know how to find the control using...
9
by: Steve | last post by:
How I can remove an AutoGenerated column? I wnat to inlcude the primary key in the resultset for creating some custom LinkButtons, but I don't want it (the PK) displayed in the DataGrid. I tried...
10
by: Nick | last post by:
Hello, Please pardon my ignorance as I'm sure this is easy to do. I have a datagrid where I want to let the user delete columns. I added a context menu to the datagrid that has a delete option....
3
by: Jason | last post by:
How do I hide a column in a GridView in ASP.NET 2.0 when all of the columns are autogenerated based on the datasource? I want to hide the first of three columns, but the following doesn't work: ...
4
by: gane | last post by:
Hi, I am creating datagrid bound column dynamically and need to check if a datagrid column already exists?Is there a way to check this? thanks gane
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
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...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.