473,499 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remove column from a DataGrid?

I've got a dataset with a couple of table columns that I don't want to
show in a DataGrid. But I want to leave the columns in the dataset.

I passed the DataSet thru a DataView, but I can't figure out how this
might work.

There are tons of examples out there on how to filter rows out of the
table. I cannot however find one that shows how to filter columns.

Can anyone point me to information on this, or tell me how to do it?

Thanks for your help.
Nov 18 '05 #1
1 1238
Hi Bruce,

Inactivate the visibility of the cells you want in the ItemCreated event.
The following example assumes the use of a datagrid control named DataGrid1.
It will make the first cell -- .Cells(0). -- invisible:

Private Sub DataGrid1_ItemCreated(ByVal sender As Object, ByVal e As
DataGridItemEventArgs) Handles DataGrid1.ItemCreated
e.Item.Cells(0).Visible = False
End Sub

Good Luck,
Antoni
"Bruce W.1" <bw@noDirectEmail.com> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...
I've got a dataset with a couple of table columns that I don't want to
show in a DataGrid. But I want to leave the columns in the dataset.

I passed the DataSet thru a DataView, but I can't figure out how this
might work.

There are tons of examples out there on how to filter rows out of the
table. I cannot however find one that shows how to filter columns.

Can anyone point me to information on this, or tell me how to do it?

Thanks for your help.

Nov 18 '05 #2

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

Similar topics

1
3393
by: J.H.. | last post by:
With who way I can remove the focus from a DataGrid Control using the key Tab in a WinForm in C# ? The key Tab transports the focus in the next column of DataGrid and no in the next WinForm Control.
1
1758
by: Chip | last post by:
I'm missing something. I'm trying to remove a column in a gridlist using the following syntax: grdList.Columns.Remove(grdList.Columns(0)) All this does is screw up the formatting in the table....
2
1188
by: Mark Hollander | last post by:
Is there a way to remove or hide the leftmost column that displays either the * or right arrow in a datagrid. -------------------------------------------------- Table Heading...
10
4924
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
9
6085
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...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.