473,799 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple column key with datagrid control

Sam
Hi all

I have a database table that has multiple column primary key and every thing
looks fine when I load it in the datagrid web control. The problem is that
the datagrid web control can only take one single field to be its
DataKeyField while my data table has multiple(2) column primary. Is there a
way to create a datagrid web control's DataKeyField which can take a
multiple columns.

Thank you

Sam
Apr 2 '06 #1
2 3462
I would use databound columns whose visible properties are set to false (to
suppress their display) to store the primary keys as in this demo:
http://www.societopia.net/samples/dataGrid_5c.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Sam" wrote:
Hi all

I have a database table that has multiple column primary key and every thing
looks fine when I load it in the datagrid web control. The problem is that
the datagrid web control can only take one single field to be its
DataKeyField while my data table has multiple(2) column primary. Is there a
way to create a datagrid web control's DataKeyField which can take a
multiple columns.

Thank you

Sam

Apr 2 '06 #2
Sam
Thanks Phillip. It's really helpful

Sam
"Phillip Williams" <WE******@newsg roups.nospam> wrote in message
news:99******** *************** ***********@mic rosoft.com...
I would use databound columns whose visible properties are set to false (to
suppress their display) to store the primary keys as in this demo:
http://www.societopia.net/samples/dataGrid_5c.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Sam" wrote:
Hi all

I have a database table that has multiple column primary key and every
thing
looks fine when I load it in the datagrid web control. The problem is
that
the datagrid web control can only take one single field to be its
DataKeyField while my data table has multiple(2) column primary. Is there
a
way to create a datagrid web control's DataKeyField which can take a
multiple columns.

Thank you

Sam

Apr 3 '06 #3

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

Similar topics

1
2221
by: Dr. Len | last post by:
Hi all! In my app I implemented a separate worker thread that handles network communication using Net.Sockets. It needs to make updates to a DataTable object, which is displayed to the user by a DataGrid control. The DataTable object is a 'public static' field instantiated within context of the main thread. The problem is that if I add a column to the DataTable from within the worker thread (eg. different thread than where the DataTable...
1
1838
by: Marty | last post by:
Is there a way to manually copy an excel cell range to a datagrid column? I am unable to select the whole column and selecting multiple whole records does not work. Thx.
2
2853
by: Pete Davis | last post by:
I have a Windows Forms datagrid with the datasource set to an ArrayList. The ArrayList is initially empty. I have DataGridColumn styles defined for 4 columns with widths, header titles, and mapping names set. The problems: 1: Now, I realize ArrayList doesn't implement IBindingList, so the
1
5292
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so the user doesn't have to scroll horizontally. Essentially, I want to wrap a datagrid row (not text in individual columns) with as much control as possible. Make sense? While this seems simple enough on the surface, I can't figure out how to do...
2
1348
by: Rubble | last post by:
Hello, Ive searched all over the net trying to find an answer to this...so anybody with some expertise in this area would be greatly appreciated. Background: I have a webform that loads a datagrid. This datagrid has a button in a column that loads another datagrid(user control) when clicked. This new grid also has a column with a button that loads another user control. So, there could be 3 user controls on this form if all the
1
3356
by: Bob Loveshade | last post by:
I am looking for an example that shows how to select and highlight multiple rows in a DataGrid. My DataGrid is part of a Web User Control which is contained in an ASPX page. I haven't been able to find any examples which demonstrate how to do this. My Code:
4
2920
by: gane | last post by:
Hi, I am creating datagrid bound column dynamically and need to check if a datagrid column already exists?Is there a way to check this? thanks gane
0
1339
by: rn5a | last post by:
A DataGrid control displays records from a SQL Server 2005 DB table. The AllowSorting property of the DataGrid has been set to True & the SortExpressions of the BoundColumns have been set to the different columns so that users can sort the DataGrid by clicking the headers in the DataGrid. The DataGrid can be sorted using all the headers in the DataGrid except for the first column header. <asp:DataGrid ID="dg1" AllowSorting="true"...
7
15664
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is there an equivalent property for the DataGridView? I have searched, but have not found one. I would like the user to be able to see all the columns of the table on one screen - thus eliminating the need to use the horizontal scroll bar to view...
0
9688
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
9546
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
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...
1
10247
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9079
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5467
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
4146
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
3762
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.