473,782 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vertical Scroll Bar out of sync in DataGrid

I'm assigning a new datasource (a datatable) to a datagrid that is
aready displayed in a form. Then I assign a new value to
CurrentRowIndex .

The datagrid always scrolls so that the new current row is visible.
However, the vertical scrollbar does not always adjust accordingly.

Upon the first instance of assigning a new datasource and setting the
currentrowindex to the _last_ record, the part of the vertical
scrollbar that can be dragged is happy to move correctly all the way
to the bottom. The newly set current row is visible at the bottom of
the grid.

If I then immediately invoke an instance of assigning a new datasource
and setting the currentrowindex to the _first_ record, the part of the
vertical scrollbar that can be dragged stays stuck all the way at the
bottom. The newly set current row is correctly visible at the top of
the grid.

I've tried various things with datagraid.VertS crollBar.Update (),
datagrid.Invali date(Me.VertScr ollBar.Region) and datagrid.refres h to
no avail.

The above sequence is part of a custom sort operation and happens when
sorting a column ascending and then immediately sorting the same
column descending. The same row is moving to either first or last in
the grid depending on the direction of the sort.

Anyone heard of this or know how to fix it?

Thanks,
Gene H.
Nov 21 '05 #1
2 3337
Gene,

Everything you always wanted to know about the datagrid.
Faqs
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp

http://www.microsoft.com/belux/nl/ms.../datagrid.mspx

Probably Ken Tucker will give you a more exact place later today

I hope this helps anyway

Cor
"Gene Hubert" <gw******@hotma il.com>
I'm assigning a new datasource (a datatable) to a datagrid that is
aready displayed in a form. Then I assign a new value to
CurrentRowIndex .

The datagrid always scrolls so that the new current row is visible.
However, the vertical scrollbar does not always adjust accordingly.

Upon the first instance of assigning a new datasource and setting the
currentrowindex to the _last_ record, the part of the vertical
scrollbar that can be dragged is happy to move correctly all the way
to the bottom. The newly set current row is visible at the bottom of
the grid.

If I then immediately invoke an instance of assigning a new datasource
and setting the currentrowindex to the _first_ record, the part of the
vertical scrollbar that can be dragged stays stuck all the way at the
bottom. The newly set current row is correctly visible at the top of
the grid.

I've tried various things with datagraid.VertS crollBar.Update (),
datagrid.Invali date(Me.VertScr ollBar.Region) and datagrid.refres h to
no avail.

The above sequence is part of a custom sort operation and happens when
sorting a column ascending and then immediately sorting the same
column descending. The same row is moving to either first or last in
the grid depending on the direction of the sort.

Anyone heard of this or know how to fix it?

Thanks,
Gene H.

Nov 21 '05 #2
Hi,

I created a column style that would adjust the row heights and had a
similar problem. My work around was to resize the grid. I decrease the
grid size by 1 pixel and brought it back to the orginal size. The
scrollbars started to work again. Change is small enough the user wont see
the change.

Ken
------------------
"Gene Hubert" <gw******@hotma il.com> wrote in message
news:7e******** *************** ***@posting.goo gle.com...
I'm assigning a new datasource (a datatable) to a datagrid that is
aready displayed in a form. Then I assign a new value to
CurrentRowIndex .

The datagrid always scrolls so that the new current row is visible.
However, the vertical scrollbar does not always adjust accordingly.

Upon the first instance of assigning a new datasource and setting the
currentrowindex to the _last_ record, the part of the vertical
scrollbar that can be dragged is happy to move correctly all the way
to the bottom. The newly set current row is visible at the bottom of
the grid.

If I then immediately invoke an instance of assigning a new datasource
and setting the currentrowindex to the _first_ record, the part of the
vertical scrollbar that can be dragged stays stuck all the way at the
bottom. The newly set current row is correctly visible at the top of
the grid.

I've tried various things with datagraid.VertS crollBar.Update (),
datagrid.Invali date(Me.VertScr ollBar.Region) and datagrid.refres h to
no avail.

The above sequence is part of a custom sort operation and happens when
sorting a column ascending and then immediately sorting the same
column descending. The same row is moving to either first or last in
the grid depending on the direction of the sort.

Anyone heard of this or know how to fix it?

Thanks,
Gene H.
Nov 21 '05 #3

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

Similar topics

0
3836
by: Sachin | last post by:
How to match the look and feel of vertical scroll bar with the inbuilt vertical scroll bars of some controls like PrintPreviewControl, Rich Text box , etc. Their scroll bars look blue where the vertical scroll bar control looks brown. please guide -- sachin
0
1588
by: Ashvin Navare | last post by:
Hi, I want to make a datagrid to be vertically scrollable instead of paging in it. So I have put that datagrid html tags inside <div></div> tags and made that div scrollable. Due to this if I scroll down vertically the datagrid, header is not shown in the datagrid view as it is scrolled up. I want datagrid to be scrollable but header of the datagrid should always be visible. To solve this problem I put a dummy datagrid at the top of
3
3299
by: sumit | last post by:
Hi, I made a data grid vertically as well as horizontal scrollable as number of columns are very large!! But when i scroll horizontally then header is not visible as it also gets scrolled up,,so to tackle this i made a different data grid having only header as the row and the other datagrid contains the actual data for it,, Due to this vertical scrolling problem goes as i have put
7
15634
by: bienwell | last post by:
Hi, I'm using the CheckBoxList control in ASP.NET for Web development. This checkboxlist is bound by the database. If we have more items for this checkbox list, it takes space on the page. I want to have vertical scroll bar (like CheckedListBox in Window development) to save space. Can we do that in ASP.NET ? Please give me your suggestions ? Thanks in advance.
2
2383
by: Doug Bell | last post by:
Hi, I have a DataGrid based on a DataView I am trying to determine if the Vertical Scroll Bar is visible? I can't find a property to return its state. Is there a way to do this and if so could you point me in the right direction?
2
2977
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a url page
0
1523
by: Greg | last post by:
I've made a datagrid multiline (for anyone interested, I used an adaptation of the code at http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp). This has introduced a very serious issue: the vertical scroll bar assumes that all row heights are the same, as the designers of the datagrid seemed to not want to cater for the fact that a datagrid could be made multi line. This results in the scroll down functionality being completely wrong -
2
2046
by: akm | last post by:
I am facing an issue with the vertical scroll bar. Actually i am using data grid to display the data in my tables, and also i am using the same view form to diplay the data for different tables. When i display the data in table1 it shows all the data with the vertical scroll bar but when i display Table1 again after displaying the Table2 which have just one row of data and hence no vertical scroll bar, the vertical scroll bar of the table1 also...
7
5619
by: Lit | last post by:
Hi, How can I capture the vertical scroll bar position for a Listbox. I have a Listbox of 100 items + when I click on it I post back remove the item selected. After returning to the client browser the list box scroll position is at the top.
0
9641
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
9480
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
10313
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
10146
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
10080
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
8968
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...
0
5378
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...
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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.