Solved

Point datagridview row while it is added.

Posted on 2010-09-04
5
381 Views
Last Modified: 2012-06-21
Hi All,

I add data to datagridview via datatable as datasource.

I want to show to user its progress while added to it.

Please see below code, the purpose is work, but always left behind one row.
I mean while pointer point to row one, the second row data is already added.

How could I do it?

Thank you.
Dim row As DataRow = dtResult.NewRow()

        Me.dgvHasilProses.Refresh()

        ERV_Global.Locate_DataGridView_Row(dgvHasilProses, dtResult.Rows.Count - 1)

        row("Id") = strEmpCode
        row("DateLog") = dteDateLog.ToString("dd MMM yyyy")
       
        dtResult.Rows.Add(row)

Open in new window

0
Comment
Question by:emi_sastra
  • 3
5 Comments
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33602521
Hi emi...
you mean that always there is a new row (empty) after you add yours?
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33602578
after you add the new row ...set Me.datagridview.CancelEdit
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33602760
use :
 Me.MyDataGridView.Rows(Me.MyDataGridView.Rows.Count - 1).Selected = True
0
 
LVL 17

Accepted Solution

by:
Zhaolai earned 500 total points
ID: 33605508
Try switching two of the lines and adding DoEvents:


Dim row As DataRow = dtResult.NewRow()

ERV_Global.Locate_DataGridView_Row(dgvHasilProses, dtResult.Rows.Count - 1)
Me.dgvHasilProses.Refresh()
Application.DoEvents()
row("Id") = strEmpCode
row("DateLog") = dteDateLog.ToString("dd MMM yyyy")

dtResult.Rows.Add(row)

Open in new window

0
 
LVL 1

Author Comment

by:emi_sastra
ID: 33608691
Hi Zhaolai,

It works.

Thank you very much for your help.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question