?
Solved

gridview record show selected... vb.net

Posted on 2014-10-01
2
Medium Priority
?
305 Views
Last Modified: 2014-10-05
The following line highlights the correct record:

Me.TblCustomersDataGridView.Rows(intCustIDReturn).Selected = True

But, row 1 (RowIndex=0)  of the first column also shows highlighted with selected triangle also in this row's RowHeader area.

Question: How can I revise the above line to show only Rows(intCustIDReturn) highlighted along with selected triangle at this row?

Thank you.
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 2000 total points
ID: 40355590
Try this:

Loop through all the Rows(loopIndexValue) and set .Selected = False.

Then, set the selected row: Rows(intCustIDReturn).Selected = True.

So, the key is to make sure they are *all* de-selected first, then select the one you want. My guess is you're selecting two without knowing it. Try this, check the value of the .Selected property in the debugger when this issue occurs.
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 40355614
Hi Dan,

Thanks for the comment. I used:
If bolHighlightActiveRow Then Me.TblCustomersDataGridView.Rows(intCustIDReturn).Selected = True
        Me.TblCustomersDataGridView.Rows(0).Selected = False
        bolHighlightActiveRow = False

Open in new window

Mainly because it is always the first row I need to deselect. This removes the highlight from first row. But, the select-triangle still stays at first row. It should be moved to Rows(intCustIDReturn).

BTW, coluld you please show me how to loop through to deselect all rows? That might be the reason why I am still having this problem.

Thanks,

Mike
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

752 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