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 5 1476
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 DataGridTableStyle to the datagrid. Then when you
attach the DataSource only columns that have a DataGridColumnStyle will
be shown but you can still access the other column from the datasource.
Hope this helps.
Chris
"Shane Story" <sstoryREMOVETHIS at lburgus dot com> wrote in message
news:ej*************@TK2MSFTNGP09.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_DataItemBound 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
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********@hotmail.comREMOVETRAIL> wrote in message
news:uy**************@TK2MSFTNGP14.phx.gbl... "Shane Story" <sstoryREMOVETHIS at lburgus dot com> wrote in message news:ej*************@TK2MSFTNGP09.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_DataItemBound 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
Thanks for the link.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP14.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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Andrew Chen |
last post by:
How do I hide any particular DataGrid Cell from visible,
or any DataColumn for the matter?
|
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...
|
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;...
|
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...
|
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...
|
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...
|
by: sivaraman.S |
last post by:
Hi friends,
How to hide a column in datagrid.
regards,
Sivaraman.S
|
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
|
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...
|
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:...
|
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,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |