473,396 Members | 2,018 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,396 software developers and data experts.

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 3421
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******@newsgroups.nospam> wrote in message
news:99**********************************@microsof t.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
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...
1
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
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...
1
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...
2
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...
1
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...
4
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
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...
7
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...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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,...
0
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...
0
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...
0
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,...

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.