Scroll Pointer in DataGridView

G

Guest

I have some buttons that increment and decrement the index of a DataGridView.
The code below gets the updated index value. The code below highlights the
first column of the current row.

dataGridView1.CurrentCell = dataGridView1[0, index];

This is almost exactly what I want. I'd really prefer it if the code above
could highlight the entire row, rather than just the first column.

Any suggestions on how to modify the code above to highlight the current
row, rather than just the first column of the current row?

Thanks,
 
J

Jeffrey Tan[MSFT]

Hi Randy,

Thanks for your pose!

You can set DataGridViewRow.Selected proerty to true to select certain row
in DataGridView. You can use DataGridView.Rows[index] to get the
DataGridViewRow reference.

Hope it helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Here's what I started with. It works great, but only selects the first cell
in the row, rather than the entire row:

dataGridView1.CurrentCell = dataGridView1[0, index];

Here's what I came up with based on your suggestion:

DataGridViewRow row = dataGridView1.Rows[index];
row.Selected = true;

This really doesn't give me quite the same functionality, as it requres me
to keep track of the previously selected row, and set row.Selected = false.
Is there no implementation of CurrentRow that give the same functionality as
CurrentCell?
 
C

Chris Jobson

randy1200 said:
Here's what I started with. It works great, but only selects the first
cell
in the row, rather than the entire row:

dataGridView1.CurrentCell = dataGridView1[0, index];

Here's what I came up with based on your suggestion:

DataGridViewRow row = dataGridView1.Rows[index];
row.Selected = true;

This really doesn't give me quite the same functionality, as it requres me
to keep track of the previously selected row, and set row.Selected =
false.
Is there no implementation of CurrentRow that give the same functionality
as
CurrentCell?

You could try setting SelectionMode to FullRowSelect, though this does mean
that you can't then select an individual cell.

Chris Jobson
 
G

Guest

I've just spent the last hour setting up Outlook Express. Unfortunately,
Outlook Express will only let me look at the last 300 messages, and
apparently, there's been more than 300 messages since I posted the original
question on 6/4/2006. The messages I can see in Outlook Express only go back
to 6/5/2006.

In Outlook Express, I've gone to Tools->Options and the Read tab. Under the
News line, I've increased the number of messages to get to 600. Still, it
only get's the first 300.

It kills me that I can't see the solution you've created. Is there some
other way to configure Outlook Express?
 
R

Randy

I figured out the Outlook Express problem. It turns out if you delete the
previously downloaded messages, it will then allow the download of the
higher number of messages.

I looked at your code. I appreciate the response - it does help.

Thanks again,
Randy

PS: If anyone else is interested, here's the lines that solve the problem:
this.dataGridView1.CurrentCell = dataGridView1[0, index];

this.dataGridView1.Rows[index].Selected = true;
 
C

Chris Jobson

randy1200 said:
I've just spent the last hour setting up Outlook Express. Unfortunately,
Outlook Express will only let me look at the last 300 messages, and
apparently, there's been more than 300 messages since I posted the
original
question on 6/4/2006. The messages I can see in Outlook Express only go
back
to 6/5/2006.

In Outlook Express, I've gone to Tools->Options and the Read tab. Under
the
News line, I've increased the number of messages to get to 600. Still, it
only get's the first 300.

It kills me that I can't see the solution you've created. Is there some
other way to configure Outlook Express?

On the Tools menu there's an option "Get Next 300 Headers" (or maybe 600 in
your case) which enables you to look at older messages. The oldest messagesa
are can see are 28th April.

Chris Jobson
 
J

Jeffrey Tan[MSFT]

I am glad my reply makes sense to you. If you need further help, please
feel free to post. Thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top