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

DataGrid: Setting the first visible row

Hi people,

How can I set a certain row as the first visible row in a DataGrid?

Thanks,
Tom T.
Nov 16 '05 #1
3 5450
Hi Tom
Get the index of the row that you want( this can be done by many means and
depends on your logic ) lets say it was row 100 . then try these two lines
dataGrid1.CurrentRowIndex=(100);
dataGrid1.Select(100);
hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
"Mohamoss" wrote:
dataGrid1.CurrentRowIndex=(100);
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC


It works like a charm, thanks.
--
Tom.
Nov 16 '05 #3
ZS

Hi ,
I'm having the same problem...
-Zelma
"Elliot" wrote:
Thanks!
I was just setting the CurrentRowIndex, and the datagrid would still remain on the currently selected row.
Just as a test, I tried using only the DataGrid.Select() method, and it didn't work.
I wonder why you need to use both statements to select a row?
"Mohamoss" wrote:
Hi Tom
Get the index of the row that you want( this can be done by many means and
depends on your logic ) lets say it was row 100 . then try these two lines
dataGrid1.CurrentRowIndex=(100);
dataGrid1.Select(100);
hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
Oct 31 '06 #4

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

Similar topics

1
by: hanct | last post by:
"this" here refer to the form.. I type this.Visible=false;..but the form still can be seen! Worst still, the property editor has no Visible property to play with..why??is that a bug?? Wat the...
5
by: Paul E Collins | last post by:
I have a Web form with a number of text boxes. If the user submits the page with some text boxes filled in, those then become plain text (with accompanying <input type="hidden"> fields for when the...
0
by: Shravan | last post by:
Hi, I have a custom datagrid extended from .Net datagrid, where I want vertical scrollbar to be visible always, for that I handled visiblechanged of VerticalScrollbar and making it visible...
0
by: Shravan | last post by:
Hi, I have a Windows Forms Custom DataGrid, which is put in a usercontrol, which on setting DataSource is setting focus to grid. The call stack for setting the focus is as follows. This is not...
1
by: TT (Tom Tempelaere) | last post by:
Hi people, How can I set the first visible row by index in a DataGrid? Thanks -- Tom T.
2
by: John Mason | last post by:
Hi, I have a datagrid of invoices with a buttoncolumn that users can click on to pay a particular invoice. Once the invoice is paid, the datagrid is reloaded, however, the button to pay the...
5
by: Dennis | last post by:
I have a class that inherits from DataGrid. I can set the rowheights in a DataGrid by tappig into the "get_Datagridrows" method. However, this does not work for classes that inherit from...
1
by: Terry Olsen | last post by:
I need a way to programmatically tell if a row is visible or has scrolled out of view. Any Ideas? Thanks!
2
by: gsb58 | last post by:
Hi! A question concerning the datagrid component in Visual Studio .NET 2003 I cannot seem to find any documentation about setting the first column (column 0) to zero, that is: make it...
0
by: Rocky | last post by:
Dear ALL, I am facing a bit problem in DATAGRID. so may be you guys can help me out. Actually on a DataGrid I am having following controls: 1) 2 DropDown Menu 2) 1 Text Box 3) 1 ADD Button 4)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.