473,503 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to select the newly added row in datagridview

I have a datagridview control and a button on the windows form. I am
adding a new row in button click event. When the number of rows grow,
the newly added row will not be
visible but a scroll bar will be shown.

I want the program to highlight the newly added row and make it visible

in the datagridview by scrolling to that position when a new row was
added by button click event. How can you do that? Thanks in advance.

Jul 12 '06 #1
1 7876
Me.DataGridView1.DataSource = dt
Me.DataGridView1.MultiSelect = False
Me.DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
Me.DataGridView1.CurrentCell = Me.DataGridView1.Item(0, 2)
(obviosuly find the cell of the newly added row by checking the row count
of your dataset or collection that is bound)

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com

"mike" <mi*********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
>I have a datagridview control and a button on the windows form. I am
adding a new row in button click event. When the number of rows grow,
the newly added row will not be
visible but a scroll bar will be shown.

I want the program to highlight the newly added row and make it visible

in the datagridview by scrolling to that position when a new row was
added by button click event. How can you do that? Thanks in advance.

Jul 12 '06 #2

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

Similar topics

2
1831
by: kindermaxiz | last post by:
hi there i have a mysql table and i want the user to add columns using a php interface and then display the table with the newly added column. I was thinking about putting all the columns...
6
2359
by: Tony Stoker | last post by:
I have a .Net web app that adds a record to a SQL database. After the user adds their record I want to have a link that will link them to their new record! The recordID is a AutoNumber in the...
3
1546
by: damezumari | last post by:
I am using WinXP and MS Access 2003. I have a list whose row source is an sql. I insert a new record to the table the sql takes its data from. I requery the list and the new record appears. ...
2
2372
by: Do | last post by:
Hi, I simply try to add new default webforms to my project and none of them can load. Has anybody received an error like this? Thanks, Do Parser Error
0
1107
by: Sooraj | last post by:
Hi all I am using vb.net 2002. To add records to grid, I click on button and display modal form with various text boxes. f.showdialog() When I save the record (by selecting MAXID from table)...
9
2461
by: =?Utf-8?B?UHJhdmlu?= | last post by:
We are using .net Framework 1.1 We are having one page on which we are using this Grid component. From this page we open a popup for adding new record as well as for editing an existing record...
0
1208
by: Patrick.O.Ige | last post by:
I have a GridView. And i'm using a DetailView to add data to a table that a GridView uses to display data. After adding a row to the table i show the Gridview with the new row added.But i would...
6
1062
by: jaz215 | last post by:
when i add data it doesn't seem to go into the recordset immediately i have to close the program and reopen before i can see the newly added data. i tried refresh and requery but it doesn't seem to...
2
2360
nev
by: nev | last post by:
i place values in a new row programatically. it has an auto-increment column. after adding the entries i do... bindingsource.endedit() tableadapter.update(dataset.datatable) the saving process...
0
7291
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
7357
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
7012
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
5598
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
5023
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
3180
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...
0
3171
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1522
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 ...
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.