473,414 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Data Grid Scroll Bar

EdB
How do I capture the position of the vertical scroll bar?

I present the grid to a user, they select an item, and I pop up an edit
window. When they are done, I need to refresh the grid (editing cell
contents of the grid is not an option here).

when I refresh the grid, the scroll bar is back at the top. I want it where
it was. I can capture the scroll event, but there doesn't seem to be a
property of the scroll bar for the position value.

Thanks in advance.

Ed


Feb 10 '06 #1
3 5022
EdB wrote:
How do I capture the position of the vertical scroll bar?

I present the grid to a user, they select an item, and I pop up an edit
window. When they are done, I need to refresh the grid (editing cell
contents of the grid is not an option here).

when I refresh the grid, the scroll bar is back at the top. I want it where
it was. I can capture the scroll event, but there doesn't seem to be a
property of the scroll bar for the position value.

Thanks in advance.

Ed


I think the way to do that is to remember the DataGrid.CurrentRoxIndex.
Then after your refresh just set the DataGrid.CurrentRowIndex and it
will jump back down to that row.

Chris
Feb 10 '06 #2
EdB
yeah, that's the ticket, thanks.

"Chris" wrote:
EdB wrote:
How do I capture the position of the vertical scroll bar?

I present the grid to a user, they select an item, and I pop up an edit
window. When they are done, I need to refresh the grid (editing cell
contents of the grid is not an option here).

when I refresh the grid, the scroll bar is back at the top. I want it where
it was. I can capture the scroll event, but there doesn't seem to be a
property of the scroll bar for the position value.

Thanks in advance.

Ed


I think the way to do that is to remember the DataGrid.CurrentRoxIndex.
Then after your refresh just set the DataGrid.CurrentRowIndex and it
will jump back down to that row.

Chris

Feb 10 '06 #3
Sounds to me like you need a SmartNavigation property for the DataGrid,
something like Internet Explorer supports.

You must be retrieving the Row Number of the Row, that was edited somewhere,
so have you tried the DataGrid.Select(RowNumber) method ? I believe that
when selected, the DataGrid would scroll down to that row, though I haven't
tried it. Let me know if it works.

If it doesn't, I guess you'll have to create your own implementation of the
DataGrid control, inheriting from System.Windows.Forms.DataGrid.

Regards,

Cerebrus.

Feb 11 '06 #4

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

Similar topics

1
by: Das | last post by:
Hi I have set a HyperLink column in the data grid. When that hyperlink column is clicked then I make that row selected. But the problem is that When there are more records in the grid. It means if...
1
by: atif | last post by:
i m using webmatrix n i hav a prob with editable data grid. i hav set the data grid with to 100% when i load the page the data grid fits into the screen 100%. but when i clicked on add new or on...
3
by: pmud | last post by:
Hi, I have a web page (asp.net, code:c#). I havean html table with text boxes. Based on the user input , records are displayed in the data grid below it. Now the datagrid has a large no. of...
1
by: Joe Dunleavy | last post by:
Hi Guys, Hopefully some one will have come across this issue already. I have a DataGrid inside a Div where a scroll bar displays once a certain height is meet --> <div id="dvSales"...
10
by: John Wilson | last post by:
My app produces some long datatables to display in a grid. So I put them in a div so users can scroll. But the grid headers scroll out of view. I would like to stop them doing this. Can I fix them...
6
by: Tom | last post by:
I need to make up a 'grid' of controls at run time. The controls (of which I wrote) I will instantiate, then I need to arrange these in a row/column layout. For example, let's say I instantiate 20...
2
by: Stephen Costanzo | last post by:
I have noticed that if I have a data grid with scrollbars and scroll it off screen and back again that the scroll bars are missing. Thinking that this was just a repaint issue, I attempted to...
0
by: Devesh | last post by:
Hi, I want to display some parameters & their value in Same data grid as shown Parameter | Value | Parameter | Value |Parameter | Value So please suggest me the way to Split...
0
by: preeti13 | last post by:
hey i need a suggesion or any idea about the data grid.Is it possible to make a data grid one column with scroll bar or not or we have to make the whole entire datagrid with scroll bar. If any...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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,...

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.