473,508 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5469
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
1945
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
3333
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
1904
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
1742
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
377
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
1721
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
4726
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
1459
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
1158
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
1218
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
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7046
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
5629
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,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
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
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
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 ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
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.