473,569 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding columns in DataGrid

I found some tutorial which had the following example for hiding columns in a
DataGrid:

http://samples.gotdotnet.com/quickst...d7.aspx&font=3

The problem is, I have no "Columns" property on my DataGrid!

I'm using Visual C# .NET IDE, which has version 1.1 of the framework. Do I
need a more advanced version of the framework?
Nov 16 '05 #1
2 2620
for win form applications you must use columsStyles to display col with
style
if yuo don't use this th column will be hidden
"MrNobody" <Mr******@discu ssions.microsof t.com> ha scritto nel messaggio
news:7E******** *************** ***********@mic rosoft.com...
I found some tutorial which had the following example for hiding columns in a DataGrid:

http://samples.gotdotnet.com/quickst...=/quickstart/a
spplus/samples/webforms/ctrlref/webctrl/datagrid/datagrid7.src&f ile=CS\datag
rid7.aspx&font= 3
The problem is, I have no "Columns" property on my DataGrid!

I'm using Visual C# .NET IDE, which has version 1.1 of the framework. Do I
need a more advanced version of the framework?

Nov 16 '05 #2
Ok, I followed your advice and looked into the column styles, but it does not
have any property like 'Visible' which I was hoping for. However, I found
that setting the width to 0 will work, just not sure if it's the most
efficient way to do it. For one thing, I have to keep a separate array of
column widths so I when the user un-hides a column I know what width to set
it to...
Nov 16 '05 #3

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

Similar topics

2
2117
by: Kevin | last post by:
Hi Al Can someone tell me how to hide colums in a datagrid. I have a one datagrid that is a master and child and I would like to hide specific columns, how do I do this TI Kevin
1
5565
by: Udi | last post by:
Hi everyone! I have a major problem with the DataGrid control for the Windows Form! I am using the DataAdapter to get data from Sql Server 2000 DataBase and populating a DataGrid with the Table i got. The problem is that i dont want to see all the table columns in the DataGrid, only some of it, how can i hide those unwanted columns? I...
0
1130
by: mpriem | last post by:
Hi, I am trying to hide a column in a datagrid I dynamicaly created, but fail to with the following code: .... .... foreach(XmlElement objStorageGroup in objServer.ChildNodes) { this.intMbSG = 0;
1
840
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems controlling the visibility of columns in the DataGrid control. The problem usually comes down to one fact. The DataGrid has a property called...
0
1074
by: klynn | last post by:
I queried a series of fields from a database and passed into a datatable. Then bound this to a datagrid. I need to hide 2 of the colums. This doesnt seem to be working the standard way. (with datagrid columns hide). When I query for number of columns in datagrid I always get 0 no matter what, even after showing all the columns. I must...
7
1435
by: David Freeman | last post by:
Hi There! Below is my VB.NET code... Dim strSQL As String strSQL = "SELECT , FROM Customers GROUP BY , , " Dim oleConn As OleDbConnection = Nothing
9
3170
by: tshad | last post by:
I have a datagrid that I want to add a new column to. This column will only be visible under certain conditions. So I want to set the column visible=false. Then when the right condition happens to change it to visible=true. You can't do that with a bound column (no ID), but you can create a templatecolumn with a label. To make these...
0
2576
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create tablestyles to format any of the columns within the datagrid, the exception "Can-not parent objects created on one thread to objects created on...
5
3691
by: Rich | last post by:
I have a datagrid that uses a dataview object for its datasource. The dataview contains a unique row identifier column. I don't want to display this column in the datagrid. I need the unique row Identifier column so that I can run updates on the SqlAdapter object. Is there a way to hide this column from the datagrid? Dim dv1 As New...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6290
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.