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

link between gui and objects

hello,

i'm have been thinking a lot about the following thing:

i have a datagrid that has a datatable as its datasource. now i want to
select one row in the datagrid and call a function which needs the
corresponding row from the datatable as its parameter.

how do i find the corresponding row in the datatable when i select a row
in the datagrid.
i was thinking to solve it like this: on the onclick event, get the
index of the selected row in the datagrid en then use that index to
select the row from the datatable. this works fine but i do not believe
that this is the best way to solve my point.

who can help me out?

thx
Dries
Nov 17 '05 #1
1 1014
Hello,

I had to implement something similar recently, and I just used the row index
from the DataGrid. I don't see anything wrong with this. The alternative
would be to build and maintain a cross reference from the DataGrid to the
DataTable, but that is an unneccessary complication if the index is adequate
for your purposes.

To make it general purpuse, I'd use a method

DataRow DataRowOf(int index)

- Javaman

"Dries De Rudder" wrote:
hello,

i'm have been thinking a lot about the following thing:

i have a datagrid that has a datatable as its datasource. now i want to
select one row in the datagrid and call a function which needs the
corresponding row from the datatable as its parameter.

how do i find the corresponding row in the datatable when i select a row
in the datagrid.
i was thinking to solve it like this: on the onclick event, get the
index of the selected row in the datagrid en then use that index to
select the row from the datatable. this works fine but i do not believe
that this is the best way to solve my point.

who can help me out?

thx
Dries

Nov 17 '05 #2

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

Similar topics

4
by: L Mehl | last post by:
Hello -- I am using Enterprise Architect, a UML modeling tool, which is built on a pre-Access 2000 mdb. The database describing the model has the extension ".eap". I want to build some...
13
by: Derek | last post by:
As I understand it there is a good amount of link compatibility among C compilers. For example, I can compile main.c with GCC and func.c with Sun One and link the objects using either linker (GNU...
3
by: joseluismarchetti | last post by:
Hello everybody, Although I am sure this is an important question for this group, I am not sure this question belongs to this group and I will be happy to move it to the correct one after you...
16
by: Shwetabh | last post by:
Hi, This is a question asked to me in an interview. I haven't been able to figure out an answer for it. Please try to see what can be done about the following problem. /* I have been given two...
1
by: Boris | last post by:
When I compile my "mixed-mode" C++ dll in Release mode, I get these warnings - LINK : warning LNK4243: DLL containing objects compiled with /clr is not linked with /NOENTRY; image may not run...
4
by: Mike Woinoski | last post by:
(I'm new to VS, so please forgive me if this is a faq.) I'm writing some Java web services and need to test them with C++ clients. I can use either a Windows Form application or an MFC application....
2
by: ikinal | last post by:
I'm getting undefined symbols when I try to put my objects in a static lib, but when I link all the objects with my main test program, everything works fine... I've traced the problem to a...
3
by: Spartanicus | last post by:
I have a list of links using the following construct: <a href='#artane' onclick='pos(1107,281)'>Artane</a> The links offer additional functionality through JS. There are no actual fragment IDs...
2
by: Guido Belligoi | last post by:
Hi, I compiled 2 simple source-files with cl -c main.cpp and cl -c test.c. test.c contains just a simple function, which is declared in test.h. test.h is included in test.c and in main.cpp....
3
by: maruf.syfullah | last post by:
Consider the following Class definitions: class AClass { int ai1; int ai2; public: CClass* c; AClass(){}
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: 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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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...
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...

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.