473,769 Members | 6,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGridView

I want to programatically select a row in the list and make it visible in
case the row is not already visible because of the length of the list
Thanks in advance,
Samuel
Aug 10 '06 #1
7 6320
Samuel Shulman wrote:
I want to programatically select a row in the list and make it visible in
case the row is not already visible because of the length of the list
Thanks in advance,
Samuel

I am actually about to do this myself, to implement a find feature for
a DataGridView.

You should be able to do this via DataGridView.Cu rrentCell

BTW, please do not rely on people reading the subject line of your
message. In fact, write the subject line *after* the message. I have no
idea why it is on top, encouraging people to title something they
haven't written yet.

B.

Aug 10 '06 #2
that works, thank you

I find that there is relatively little knowledge about this control which is
extremely useful

Samuel
"Brian Tkatch" <Ma***********@ ThePentagon.com wrote in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
Samuel Shulman wrote:
>I want to programatically select a row in the list and make it visible in
case the row is not already visible because of the length of the list
Thanks in advance,
Samuel


I am actually about to do this myself, to implement a find feature for
a DataGridView.

You should be able to do this via DataGridView.Cu rrentCell

BTW, please do not rely on people reading the subject line of your
message. In fact, write the subject line *after* the message. I have no
idea why it is on top, encouraging people to title something they
haven't written yet.

B.

Aug 10 '06 #3
Samuel,
>
I find that there is relatively little knowledge about this control which
is extremely useful
I would not say so it is constantly growing, however especially Ken is
constantly putting more information about the DataGridView on our website.

http://www.vb-tips.com/dbpages.aspx?IA=DG2

You can have a look at the CodeCamp button as well to see Ken's presentation
about the DataGridView

I hope this helps,

Cor
Samuel
"Brian Tkatch" <Ma***********@ ThePentagon.com wrote in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
>Samuel Shulman wrote:
>>I want to programatically select a row in the list and make it visible
in
case the row is not already visible because of the length of the list
Thanks in advance,
Samuel


I am actually about to do this myself, to implement a find feature for
a DataGridView.

You should be able to do this via DataGridView.Cu rrentCell

BTW, please do not rely on people reading the subject line of your
message. In fact, write the subject line *after* the message. I have no
idea why it is on top, encouraging people to title something they
haven't written yet.

B.


Aug 11 '06 #4
On Thu, 10 Aug 2006 16:37:46 +0100, "Samuel Shulman" <sa************ @ntlworld.comwr ote:
>I want to programatically select a row in the list and make it visible in
case the row is not already visible because of the length of the list
Thanks in advance,
Samuel
If you know the RowIndex of the selected item:

Me.DataGridView .FirstDisplayed ScrollingRowInd ex = Value

Where value is the Row Index to be displayed at the first visible position
Gene

Aug 11 '06 #5
Brian and Samuel,
BTW, please do not rely on people reading the subject line of your
message. In fact, write the subject line *after* the message. I have no
idea why it is on top, encouraging people to title something they
haven't written yet.
Some newsreaders will try to find the same subject and place that in top of
an existing one.
(Which can be depending the options set for that newsreader and if it still
exist on the newsserver, but the latest is often with Google when the
subject is not good set).

Therefore it is not clever to use a Subject as "DataGridVi ew" or by instance
"Help".

(In this way you can by instance reset the date and time by *newsgroup*
topposters. Don't confuse this with email topposters).

I hope this gives an idea,

Cor


Aug 11 '06 #6

gene kelley wrote:
On Thu, 10 Aug 2006 16:37:46 +0100, "Samuel Shulman" <sa************ @ntlworld.comwr ote:
I want to programatically select a row in the list and make it visible in
case the row is not already visible because of the length of the list
Thanks in advance,
Samuel

If you know the RowIndex of the selected item:

Me.DataGridView .FirstDisplayed ScrollingRowInd ex = Value

Where value is the Row Index to be displayed at the first visible position
Gene
Very nice. I think this is what i will use.

These names are so confusing. :)

B.

Aug 11 '06 #7
On 11 Aug 2006 06:32:29 -0700, "Brian Tkatch" <Ma***********@ ThePentagon.com wrote:
>
gene kelley wrote:
>On Thu, 10 Aug 2006 16:37:46 +0100, "Samuel Shulman" <sa************ @ntlworld.comwr ote:
>I want to programatically select a row in the list and make it visible in
case the row is not already visible because of the length of the list
Thanks in advance,
Samuel

If you know the RowIndex of the selected item:

Me.DataGridVie w.FirstDisplaye dScrollingRowIn dex = Value

Where value is the Row Index to be displayed at the first visible position
Gene

Very nice. I think this is what i will use.

These names are so confusing. :)

B.
Yes, it is/was confusing. For years, this generally is commonly called "EnsureVisi ble" as is the
case with the ListView.

Gene
Aug 11 '06 #8

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

Similar topics

0
3629
by: DraguVaso | last post by:
Hi, I'm using the DataGridView in VB.NET 2.0. The DataSource is a Generic List of a custom class0: lstMyPersonnes = New List(Of clsPersonne). When I add a new clsPersonne to lstMyPersonnes, and rebind the lstMyPersonnes to my DataGridView.dataSource, it shows the new record in the DataGridView as it should be. But when I click on a cell of that row, I suddenly got this error: "Index -1
6
6417
by: dbuchanan | last post by:
Hello, Is this a bug? Is there some kind of work around? I want to add default values for a few columns in my datagridview I found the "DefaultValuesNeeded" event for the datagridview I gave it a try using the example given in
10
39514
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got some DataGridViewTextBoxCell, DataGridViewComboBoxCell etc, i want to export all that to XML.. Any help is greatly appreciated.
3
32273
by: Rich | last post by:
Hello, I am populating a datagridview from a datatable and filtering the number of rows with a dataview object. Is there a way to retrieve the rows displayed by the datagridview into a separate datatable without having to loop through each column in the datagridview? Or is there a way to retrieve the rows from the original datatable filtered by the dataview into a separate table? I only want to copy the rows from the main table that...
2
24558
by: bob | last post by:
Can anyone tell me the best way to update a dataset while it is being edited/viewed in the DataGridView control? Is this something that should be inserted into one of the grid's events? or should you update after closing the grid/form, etc.? Also, can you tell me the best book to buy that fully explains the DataGridView control? Thanks.
7
12631
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's the background for my question... Before I switched my application over to the Fx 2.0, I used a DataGrid to display my data. I would store different DataGridTableStyles (each one with a custom set of columns) in the DataGrid.TableStyles property...
7
15658
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is there an equivalent property for the DataGridView? I have searched, but have not found one. I would like the user to be able to see all the columns of the table on one screen - thus eliminating the need to use the horizontal scroll bar to view...
0
2506
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by my.
3
5744
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows few celltemplate property getters and combobox/datecombo constructor calls without database access which does not take a lot of time. Debug output (below) shows lot of messages Stepping over non-user code. Running in release mode from...
0
5657
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be blank unless they are filled by the user. 2) As soon as the user enters a cell, the dtp control should appear as the editing control of that cell. If there's a value in the cell beforehand, that value is set as the value of the dtp editing control...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
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 we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.