473,384 Members | 1,854 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,384 software developers and data experts.

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 1779

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
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
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.