473,597 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGridView and Selected Row

If I can explain it.

I have a DataGridView with say 100 rows, 30 of which will display on the
screen.

If I drag down the vertical scroll bar so that say row 50 is the centre
row vertically and click on the row header, the row is selected ok but
it is positioned at the bottom of the control as the second last row on
the screen.

My question: How do I make it so that when I select a row, vertical
movement doesn't occur ?
Jun 27 '08 #1
2 1974
I can't reproduce this; are you sure there aren't any other events firing to
cause this to happen?

"Ian Semmel" <an****@rocketc omp.com.auwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
If I can explain it.

I have a DataGridView with say 100 rows, 30 of which will display on the
screen.

If I drag down the vertical scroll bar so that say row 50 is the centre
row vertically and click on the row header, the row is selected ok but it
is positioned at the bottom of the control as the second last row on the
screen.

My question: How do I make it so that when I select a row, vertical
movement doesn't occur ?

Jun 27 '08 #2
Probably are. DataGridViews and me aren't 100% compatible.

If it's not a feature, I will play around with it some more.

"Nathan" <ms********@mac gregorfamily.ne twrote in message
news:98******** *************** ***********@mic rosoft.com:
I can't reproduce this; are you sure there aren't any other events
firing to
cause this to happen?

"Ian Semmel" <an****@rocketc omp.com.auwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
If I can explain it.

I have a DataGridView with say 100 rows, 30 of which will display on
the
screen.

If I drag down the vertical scroll bar so that say row 50 is the
centre
row vertically and click on the row header, the row is selected ok but
it
is positioned at the bottom of the control as the second last row on
the
screen.

My question: How do I make it so that when I select a row, vertical
movement doesn't occur ?
Jun 27 '08 #3

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

Similar topics

1
4266
by: cc | last post by:
Hi, using the DataGridView (.NET 2005) : I have a row currently selected in the Grid (say the 3rd row showing 'Product3') Now, when I click on a column to sort the records is the 'Product3' row located as first row in the Grid but not selected (highlighted) anymore. The position of the selected (highlighted)-row doesn't change and is still located on the 3rd row, thus showing a dfifferent product. I don't want
1
18821
by: Dave A | last post by:
Hi, I am struggling with two way databinding in WinForms and the DataGridView. I am binding to business object classes (rather than datatables). If I have a collection of these business objects that is the datasource of a DataBinding that is bound to a DataGridView (WinForms) then I was expecting that any change to the data would be reflected in the DataGridView (in other words I was expecting the 2 way databinding to actually...
3
23504
by: Karl Rhodes | last post by:
I have a datagridview which is populated via a datatable. What I would like to dynamically set a selected row and have that row show up in the datagridview and not have to manually scroll to find the selected row. I had a look for all kind of "datagridview1.rows(i).focus" but there doesnt seem to be anything. Can anyone help? I know this must be quite simple to do but cant find it.
1
4158
by: Riley | last post by:
Need some help. I am using datagridview in 2005 with C#. I am calling a web service and filling the datagridview with the data returned. This all works fine. Next step is to take a value from one of the cells in the datagridview and return it back with some other values in an object for another webservice call. The problem is I dont know how to access a cell in a datagridview to do this. Im pretty sure you have to do it thru the binding...
3
6320
by: =?Utf-8?B?Sm9obiBCdW5keQ==?= | last post by:
New to databinding in vs2005, I always did it manually in 2003. I have no problem loading comboboxes, and a change in that combobox changes the data in the textboxes but I can not figure out a way to get the data in a datagridview to change. For example 2 columns are ID and amount_paid, the datagridview loads on form load with all ID's and amounts. How do I get it to only bring back the selected ID. Sounds like I may need to change the SQL...
7
15640
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...
12
13592
by: cj | last post by:
When viewing a datatable in a datagridview one of the columns in it is a "note" field which can be quite long. I would like to have the note field of the currently selected row of the datagrid display in a textbox below the datgridview. I currently have it fixed so if you click on a row the note field from that row is put in the textbox. I'd like this to be automatic as they move through rows. Also the note field is one of two fields...
2
5939
by: colin | last post by:
Hi, I need to tell how many rows are visible on the screen, in my DataGridView control so that I can ensure my newly selected row is visible without doing any unecessry scrolling, I thought RowCount would give me this :- Summary: Gets or sets the number of rows displayed in the System.Windows.Forms.DataGridView.
6
4402
by: hzgt9b | last post by:
Using VS2005, VB.NET, I have a windows app with a DataGridView (lets call it DGV). At some point in the life of my app I want to clear the selection of the currently selected row (Multiselect=false) from DGV - to do that I tried this: DGV.ClearSelection() Cosmetically this appears to work but it appears that the DGV still stores the index value of the selected row. If the 1st row I click on after executing ClearSelection() is the row...
0
1747
by: =?Utf-8?B?QXR1bCBSYW5l?= | last post by:
Hi, I am using datagridview when, I am assigning datasource to Datagridview i am gettin exception "Child list for field Region cannot be created." I am Assigning Collection as a datasource to the datagridview. AnnotationGrid.DataSource = XMLAnnotations; AnnotationGrid.DataMember = "Region"; and my grid has three coloumns ID, Area, Text and XMLAnnotation consist xml
0
7970
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8036
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8259
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
5434
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
3886
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2404
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
1
1494
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1241
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.