473,881 Members | 1,644 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 3341
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
3845
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
1589
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
3302
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
15639
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
2386
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
2987
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
1528
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
2047
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
5650
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
9928
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
9776
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
11100
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...
1
10816
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
10402
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...
1
7953
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
7111
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
5977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4196
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.