473,387 Members | 1,569 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,387 software developers and data experts.

hiding key columns in datagrid.

Okay, I know that the DataKeyField property of a DataGrid is supposed to
allow me to define a field which will not be displayed. The values in that
column end up in the DataKeys collection. My problem is that the column is
still being rendered. I even tried the sample in the MSDN library for the
DataKeyField and the column is showing. I though that this was supposed to
give me the ability to hide the key column. Is there anything else I need
to do besides setting DataKeyField?

Nov 16 '05 #1
2 1528

thats weird and all but you can set the visiibility of the column,
just look in its properties. also, are you autogenerating the columns?
On Thu, 3 Feb 2005 13:12:05 -0800, "Peter Rilling"
<pe***@nospam.rilling.net> wrote:
Okay, I know that the DataKeyField property of a DataGrid is supposed to
allow me to define a field which will not be displayed. The values in that
column end up in the DataKeys collection. My problem is that the column is
still being rendered. I even tried the sample in the MSDN library for the
DataKeyField and the column is showing. I though that this was supposed to
give me the ability to hide the key column. Is there anything else I need
to do besides setting DataKeyField?


Nov 16 '05 #2
Hi,

What if you set the column width to 0?

That works in a web grid, no idea in a windows one though.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:O6*************@TK2MSFTNGP09.phx.gbl...
Okay, I know that the DataKeyField property of a DataGrid is supposed to
allow me to define a field which will not be displayed. The values in
that
column end up in the DataKeys collection. My problem is that the column
is
still being rendered. I even tried the sample in the MSDN library for the
DataKeyField and the column is showing. I though that this was supposed
to
give me the ability to hide the key column. Is there anything else I need
to do besides setting DataKeyField?

Nov 16 '05 #3

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

Similar topics

2
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
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...
2
by: MrNobody | last post by:
I found some tutorial which had the following example for hiding columns in a DataGrid: ...
0
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) {...
1
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...
0
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...
7
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
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...
0
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...
5
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.