473,783 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide Datagrid columns

I have a dataset with two tables.

I make data view of each table, connect the parent table to one data grid
and the child table to the other datagrid, with a row filter, that gets set
when a user clicks a row in the parent.

I have PK/FK in the tables to know what to display.

I want to hide the PK/FK columns in the U/I, but still use them.

I can't seem to find a way to do this.

Any help would be appreciated.

Thanks,

Shane
Nov 21 '05 #1
5 1492
Shane Story wrote:
I have a dataset with two tables.

I make data view of each table, connect the parent table to one data grid
and the child table to the other datagrid, with a row filter, that gets set
when a user clicks a row in the parent.

I have PK/FK in the tables to know what to display.

I want to hide the PK/FK columns in the U/I, but still use them.

I can't seem to find a way to do this.

Any help would be appreciated.

Thanks,

Shane


You have to assign a DataGridTableSt yle to the datagrid. Then when you
attach the DataSource only columns that have a DataGridColumnS tyle will
be shown but you can still access the other column from the datasource.

Hope this helps.

Chris
Nov 21 '05 #2

"Shane Story" <sstoryREMOVETH IS at lburgus dot com> wrote in message
news:ej******** *****@TK2MSFTNG P09.phx.gbl...
I have a dataset with two tables.

I make data view of each table, connect the parent table to one data grid
and the child table to the other datagrid, with a row filter, that gets
set
when a user clicks a row in the parent.

I have PK/FK in the tables to know what to display.

I want to hide the PK/FK columns in the U/I, but still use them.

I can't seem to find a way to do this.

Any help would be appreciated.

Thanks,

Shane


Is this ASP.Net or WinForms? Not sure how to do the equivalent in WinForms,
but in ASP.Net you would handle the DataGrid_DataIt emBound event. Check to
see if e.Item.ItemType is the type you want to mess with, then convert
e.Item.DataItem .Row to your DataRow. That would give you all values for the
DataItem that was bound.

HTH,
Mythran

Nov 21 '05 #3
It is a Win forms app. I already have it doing this... just have problems
because I need to hide columns and the one I need to hide is the PK in the
parent that I need to use for hidden FK in the child.
"Mythran" <ki********@hot mail.comREMOVET RAIL> wrote in message
news:uy******** ******@TK2MSFTN GP14.phx.gbl...

"Shane Story" <sstoryREMOVETH IS at lburgus dot com> wrote in message
news:ej******** *****@TK2MSFTNG P09.phx.gbl...
I have a dataset with two tables.

I make data view of each table, connect the parent table to one data grid and the child table to the other datagrid, with a row filter, that gets
set
when a user clicks a row in the parent.

I have PK/FK in the tables to know what to display.

I want to hide the PK/FK columns in the U/I, but still use them.

I can't seem to find a way to do this.

Any help would be appreciated.

Thanks,

Shane
Is this ASP.Net or WinForms? Not sure how to do the equivalent in

WinForms, but in ASP.Net you would handle the DataGrid_DataIt emBound event. Check to see if e.Item.ItemType is the type you want to mess with, then convert
e.Item.DataItem .Row to your DataRow. That would give you all values for the DataItem that was bound.

HTH,
Mythran

Nov 21 '05 #4
Shane,

Did you already have a look at our website, it is based on VBNet and has a
lot of samples for the Datagrid.

http://www.windowsformsdatagridhelp.com/default.aspx

I hope this helps,

Cor
Nov 21 '05 #5
Thanks for the link.

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Shane,

Did you already have a look at our website, it is based on VBNet and has a
lot of samples for the Datagrid.

http://www.windowsformsdatagridhelp.com/default.aspx

I hope this helps,

Cor

Nov 21 '05 #6

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

Similar topics

2
4285
by: Andrew Chen | last post by:
How do I hide any particular DataGrid Cell from visible, or any DataColumn for the matter?
6
8416
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 data grid with the db: public static void DataGrid(DataGrid DG,string sql) { //Initialize connection with the db
4
5691
by: Tim | last post by:
Hi, I am trying to hide the datagrid row header (the left most column that has the 'select' triangle in it which moves with the selected row). It seems to be fairly simple; this.dgStockMasterSummary.RowHeadersVisible = false; however it doesn't hide it. Hiding the column headers works just fine. Does anyone have any ideas?
1
14510
by: J Gao | last post by:
Hi All, I am using Data binding with DataGrid. I need to hide column in the grid using DataGrid1.Columns(1).Visible = False But I get the following error message Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
2
4310
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 = False (the message at runtime is something like index out of range, and under the debuger, I discover that the attribute count of the columns collection is 0!) Below is my piece of code.
8
7319
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 anyway to do that?
3
1713
by: sivaraman.S | last post by:
Hi friends, How to hide a column in datagrid. regards, Sivaraman.S
5
7813
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
1
3007
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 System.IO.StringWriter Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)
9
9769
by: moondaddy | last post by:
using c# 3.5 I have list of business objects which I will use in lists for databinding and I want to hide some of the fields so they don't show up in the list control. some of my list will be: List<someClasslist Observable collections and a custom list derived from the BindingList.
0
9643
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10147
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.