473,480 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

datagrid current row

Gday,

Am new to using datagrids so if anyone could assist or point in the right
direction in terms of resources - that would be much appreciated...

I have a form that has:

- a datagrid that displays summary data
- other controls (eg textboxes, comboboxes) that are editable

What I would like is when a use selects a row in the datagrid that the all
corresponding fields for that row of data shows up in the other controls
from where they can be edited.

I dont like the idea of depending on the datagrid position attribute to
return the selected row, as I would like to allow the datagrid to be able to
be sorted on any column - hence the position would appear to be
useless...unless you changed the form's dataview everytime the datagrid gets
re-sorted?

I believe what I need to do is get the key of selected row in the datagrid
and use this to synchronise the data that is getting displayed on the rest
of the form but am not sure of how to go about this...

If there are alternatives I would love to hear them.

Regards,

Peter

Nov 8 '05 #1
2 1780

use this to select 1 item from your selected row.

dtgrid = the datagrid
currentrowindex = the selected row
5 = the 5th column

dtgrid.Item(Trim("" & dtgrid.CurrentRowIndex().ToString()), 5)

if this post was helpfull then click on Yes please below this post.

greets,

interwanderer
"mrstrong" wrote:
Gday,

Am new to using datagrids so if anyone could assist or point in the right
direction in terms of resources - that would be much appreciated...

I have a form that has:

- a datagrid that displays summary data
- other controls (eg textboxes, comboboxes) that are editable

What I would like is when a use selects a row in the datagrid that the all
corresponding fields for that row of data shows up in the other controls
from where they can be edited.

I dont like the idea of depending on the datagrid position attribute to
return the selected row, as I would like to allow the datagrid to be able to
be sorted on any column - hence the position would appear to be
useless...unless you changed the form's dataview everytime the datagrid gets
re-sorted?

I believe what I need to do is get the key of selected row in the datagrid
and use this to synchronise the data that is getting displayed on the rest
of the form but am not sure of how to go about this...

If there are alternatives I would love to hear them.

Regards,

Peter

Nov 8 '05 #2
Mr Strong,

See this sample. it uses labels now it was a sample with textboxes some
hours ago.

http://www.vb-tips.com/default.aspx?...f-587f730fa118

I hope this helps,

Cor
Nov 8 '05 #3

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

Similar topics

0
4019
by: Faith | last post by:
I found code on www.codeproject.com. Here is a sample it is called DataGridColumnDropDown. I modified it to use the text box when I wanted it to depended on a certain search criteria. Public...
2
9905
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
3
2247
by: Carolyn Vo | last post by:
I have a datagrid in my web control class that I am trying to get the current rows displayed for. I have enabled paging on the datagrid so if the user is currently on page 3 of 8, and if I have...
2
3265
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
1
4274
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
4
7347
by: Suzanne | last post by:
Hi all, I'm having problems with datagrids and the currentcellchanged event. My problem is this: I have a datagrid on a form, if the user changes the text in a cell on the datagrid then tries to...
3
1557
by: Tim McKinney | last post by:
I have a read-only datagrid that I use to display a heirarchal model of three tables (The example I am setting up uses the Customer, Orders, and Order Detail tables from the northwind database). I...
5
5883
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
0
1875
by: Melson | last post by:
Hi Can anyone help me with this problem. I've a form1(entry form) with datagrid which bound to a dataset (datagrid.setdatabinding(dataset,"table")). I've a public class Capturekey in form1 which...
6
2718
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
0
7055
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
6920
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...
0
7061
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
7110
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...
1
6763
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
5367
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,...
1
4799
isladogs
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...
0
3011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1313
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 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.