473,471 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Hide the 1st Column of the DataGrid?

Hi, I was wondering if it was possible to hide the first column of the datagrid (windows form control). The column that I am referring to is the column created by the control that is gray in color and contains the selection arrow. My goal is to use the datagrid in place of a ListView control for performance reasons. To keep this new control like a ListView control, I need to not display this column. Any ideas?

Thanks in advance,

C. Buck
Nov 15 '05 #1
6 6268
C. Buck,

You can set the RowHeadersVisible property to false, and it should not
display the row headers.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"CBuck" <an*******@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
Hi, I was wondering if it was possible to hide the first column of the datagrid (windows form control). The column that I am referring to is the
column created by the control that is gray in color and contains the
selection arrow. My goal is to use the datagrid in place of a ListView
control for performance reasons. To keep this new control like a ListView
control, I need to not display this column. Any ideas?
Thanks in advance,

C. Buck

Nov 15 '05 #2
It's a hack, but I believe setting the width to 0 will do it for you.
"CBuck" <an*******@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
Hi, I was wondering if it was possible to hide the first column of the datagrid (windows form control). The column that I am referring to is the
column created by the control that is gray in color and contains the
selection arrow. My goal is to use the datagrid in place of a ListView
control for performance reasons. To keep this new control like a ListView
control, I need to not display this column. Any ideas?
Thanks in advance,

C. Buck

Nov 15 '05 #3
I tried doing that, and it made no difference. I am new to this control, so maybe I am missing something. Do you have a code snipet that does this?

- Thanks

- Buck
Nov 15 '05 #4
I tried 0, but the column width changed to just enough for the arrow.
Nov 15 '05 #5
Nevermind... I go it! Thanks!
Nov 15 '05 #6
CBuck <an*******@discussions.microsoft.com> wrote:
Nevermind... I go it! Thanks!


How did you do it, out of interest? I'm intrigued now.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #7

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...
1
by: enak | last post by:
I populate a datagrid by setting the datasource to a datatable. I then, bind them. After that I try to hide the last column but am not able to. I get an error message. Here is my code: ...
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...
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
2
by: Keithb | last post by:
I need to hide a GridView's "edit" column if the user's role does not support editing. However, the column's Visible property does not support databinding. Is there a workaround? Thanks, ...
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...
1
by: TonyJ | last post by:
Hello! Assume I have a datasource consisting of a database table. This table has 5 column. If I now want to use a bound datagrid but want to display only 4 of these 5 columns is that...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.