Fellow .Netters,
I have come to an impass trying to "hide" a column on a data grid - I'm sure
it's a fairly simple thing (but so am I, that's why I'm stuck)
Imagine if you will that I have a table as structure thus (this is all an
example)
PartID (string)
Part Code (string)
Description (string)
InStock (string)
Now, the PartID field is purely an internal code which has no display value
whatsoever but is needed internally by the system for various other purpose.
My Select statement is simply "Select * from Parts...." and what I want to
do is display all the columns, except the Part ID...but retain the PartID
for other actions required later (as it's in a specific format)
Please put me out of my misery and help me solve this...
Chris.... 4 1565
Chris,
You can find just about everything you ever wanted to know about the WinForms DataGrid here: http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp
Check out item 5.13 for your specific issue. http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q708q
hth,
Steve
"Chris H." wrote: Fellow .Netters,
I have come to an impass trying to "hide" a column on a data grid - I'm sure it's a fairly simple thing (but so am I, that's why I'm stuck)
Imagine if you will that I have a table as structure thus (this is all an example)
PartID (string) Part Code (string) Description (string) InStock (string)
Now, the PartID field is purely an internal code which has no display value whatsoever but is needed internally by the system for various other purpose.
My Select statement is simply "Select * from Parts...." and what I want to do is display all the columns, except the Part ID...but retain the PartID for other actions required later (as it's in a specific format)
Please put me out of my misery and help me solve this...
Chris....
Thanks....That's did the job....
"Steve" <St***@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com... Chris,
You can find just about everything you ever wanted to know about the
WinForms DataGrid here: http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp
Check out item 5.13 for your specific issue. http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q708q
hth, Steve
"Chris H." wrote:
Fellow .Netters,
I have come to an impass trying to "hide" a column on a data grid - I'm
sure it's a fairly simple thing (but so am I, that's why I'm stuck)
Imagine if you will that I have a table as structure thus (this is all
an example)
PartID (string) Part Code (string) Description (string) InStock (string)
Now, the PartID field is purely an internal code which has no display
value whatsoever but is needed internally by the system for various other
purpose. My Select statement is simply "Select * from Parts...." and what I want
to do is display all the columns, except the Part ID...but retain the
PartID for other actions required later (as it's in a specific format)
Please put me out of my misery and help me solve this...
Chris....
Chris:
I know that your question has already been answered so you'll probably
never look here again, but you might try looking at the DataKeys
collection of the DataGrid to solve your problem in the future, rather
than relying on hidden columns.
Basically, when you are databinding, i.e.:
dataGrid1.DataSource = intentory.GetList();
dataGrid1.DataBind();
Add this before you DataBind() call:
dataGrid1.DataKeyField = "PartID"; // Assuming PartID is serializable
Later, in your ItemCommand event handler, you can just do this:
string partID = dataGrid1.DataKeys[e.Item.ItemIndex].ToString();
To retrieve the PartID. Makes things cleaner if you ask me... but you
didn't! :)
Enjoy,
Sean
Chris H. wrote: Fellow .Netters,
I have come to an impass trying to "hide" a column on a data grid - I'm sure it's a fairly simple thing (but so am I, that's why I'm stuck)
Imagine if you will that I have a table as structure thus (this is all an example)
PartID (string) Part Code (string) Description (string) InStock (string)
Now, the PartID field is purely an internal code which has no display value whatsoever but is needed internally by the system for various other purpose.
My Select statement is simply "Select * from Parts...." and what I want to do is display all the columns, except the Part ID...but retain the PartID for other actions required later (as it's in a specific format)
Please put me out of my misery and help me solve this...
Chris....
Thanks Sean.....any advice is good at the moment, I'm still a novice at
this...just have to work out now how to make the grid Non-Edittable with Row
Selection (just a scrolling list that the user selects and then off it goes
and does some stuff....)
"Sean Bright" <se**@noreply.com> wrote in message
news:gP********************@giganews.com... Chris:
I know that your question has already been answered so you'll probably never look here again, but you might try looking at the DataKeys collection of the DataGrid to solve your problem in the future, rather than relying on hidden columns.
Basically, when you are databinding, i.e.:
dataGrid1.DataSource = intentory.GetList(); dataGrid1.DataBind();
Add this before you DataBind() call:
dataGrid1.DataKeyField = "PartID"; // Assuming PartID is serializable
Later, in your ItemCommand event handler, you can just do this:
string partID = dataGrid1.DataKeys[e.Item.ItemIndex].ToString();
To retrieve the PartID. Makes things cleaner if you ask me... but you didn't! :)
Enjoy, Sean
Chris H. wrote:
Fellow .Netters,
I have come to an impass trying to "hide" a column on a data grid - I'm
sure it's a fairly simple thing (but so am I, that's why I'm stuck)
Imagine if you will that I have a table as structure thus (this is all
an example)
PartID (string) Part Code (string) Description (string) InStock (string)
Now, the PartID field is purely an internal code which has no display
value whatsoever but is needed internally by the system for various other
purpose. My Select statement is simply "Select * from Parts...." and what I want
to do is display all the columns, except the Part ID...but retain the
PartID for other actions required later (as it's in a specific format)
Please put me out of my misery and help me solve this...
Chris.... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: adam |
last post by:
<SCRIPT language=JavaScript1.2>
function setcountdown(theyear,themonth,theday,thehour,themin,thesec){
yr=theyear;mo=themonth;da=theday;hr=thehour;min=themin;sec=thesec
}
// modify the following...
|
by: Brian |
last post by:
Help..
We cannot get this script to work..can someone take a look at it and make
suggestions?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Convert...
|
by: mwh |
last post by:
Hi. If you remember, I posted Expressons Help. Now I am making a
calculator with javascript. I can't get this to work:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"...
|
by: Chris H. |
last post by:
Fellow .Netters,
I have come to an impass trying to "hide" a column on a data grid - I'm sure
it's a fairly simple thing (but so am I, that's why I'm stuck)
Imagine if you will that I have a...
|
by: Cesar Ronchese |
last post by:
Hi,
I built the sample code showing the problem with dates when viewed at
different machines, different Time Zones and transported via Remoting.
The zip can be downloaded here:
...
| |
by: Scott |
last post by:
Ok. Brand new at this so please give a little patience and help me on the
baby steps. I'm rewriting something I did initially in PHP / MySql on a
vb.net / mysql platform. Here's what I'm doing:...
|
by: Dave |
last post by:
Hi,
I'm using .NET 1.1 and wondering if I can use RequiredFieldValidators with
required fields inside user controls.
The page is a type of tabbed panel layout with the divs show/hidden using...
|
by: colemanj4 |
last post by:
Here is what I have so far, it loops while the PW is incorrect, or
until cancel is selected. I want it to lock the tables for adds,
deletes, and edits when cancel is selected, and if the PW is...
|
by: Nergock |
last post by:
Have anyone run into this difference with SQL Server 2005 and the
SqlDataTable Load method?
In SQL Server 2000, when I create a table using the SqlDataTable.Load
method passing it a...
|
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: 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: 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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |
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...
| |