473,396 Members | 2,020 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,396 software developers and data experts.

Datagrid scrolling....

Hi All,

i have a datagrid table that contains customers names, and a textbox which
the user enters the customer name and the datagrid's dataset is updated so
the customer name will be first. anyway i want to that user will be able also
to navigate with the down and up arrows throw the names that already
displayed. my foucus is always on the textbox (becuase if i put the focus on
the datagrid i won't be able to enter any more charachters unless i put the
focus back on the text box) and i created key event that starts when ever the
user prees and up or down buttons. my problem is that if my datagrid, for
example, contains 100 rows and only 15 displayed at the time, when the user
will navigate to row no. 16 it won't be shown unless he will scroll down the
datagrid. i would like to make that when the datagrid gets to it's last
displayed row it will scroll automaticly so i will always see the row i point
at.

it was long but i hope not too long...

thanks
Nov 17 '05 #1
1 1757
Hi,

A kind of a hack, but you can first update the grid's CurrentCell property
to force the grid to set focus to an appropriate cell and thus scroll the
cell into view, and immediately after that you can probably call
textBox.SetFocus() to return the focus to the textbox.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Gidi" <sh*****@hotmail.com.dontspam> wrote in message
news:34**********************************@microsof t.com...
Hi All,

i have a datagrid table that contains customers names, and a textbox which
the user enters the customer name and the datagrid's dataset is updated so
the customer name will be first. anyway i want to that user will be able
also
to navigate with the down and up arrows throw the names that already
displayed. my foucus is always on the textbox (becuase if i put the focus
on
the datagrid i won't be able to enter any more charachters unless i put
the
focus back on the text box) and i created key event that starts when ever
the
user prees and up or down buttons. my problem is that if my datagrid, for
example, contains 100 rows and only 15 displayed at the time, when the
user
will navigate to row no. 16 it won't be shown unless he will scroll down
the
datagrid. i would like to make that when the datagrid gets to it's last
displayed row it will scroll automaticly so i will always see the row i
point
at.

it was long but i hope not too long...

thanks


Nov 17 '05 #2

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

Similar topics

3
by: Igor Mendizabal | last post by:
Hello, We're doing our own datagrid based on the System.windows.forms.datagrid control, and are having some problems with horizontal scrolling. In general, we construct our datagrid adding a...
0
by: Frnak McKenney | last post by:
I have a (small) multi-table database application which allows edits, print reports, and has two scrolling screen displays which show information merged from multiple tables. I'm having trouble...
1
by: john sutor | last post by:
Does anyone know if you can display vertical scroll or horizontal scroll bars on the datagrid ???
0
by: Tom | last post by:
I need to know how far my windows form data grid is scrolling horizontally. Ideally I would like to know how many pixels. I know there is a protected (at least) property in the datagrid called...
1
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so...
8
by: pmud | last post by:
Hi, I have 2 questions: 1. I have an editable data grid with 21 columns. I need to edit only 2 cloumns in this data grid. But when the grid is displayed in Edit mode, all the columns show long...
1
by: John Bayly via .NET 247 | last post by:
I'm working on an inherited Datagrid class that includes afunction called onMouseMove to paint the row under the cursor tomake reading easier for users. To paint the row, the function sets the...
0
by: Dan Hinsley | last post by:
I just got one of the new Microsoft Mice that has a "tilt wheel" for horizontal scrolling. This works in a listbox in my VB.NET app, but doesn't work for a datagrid that does have a horizontal...
3
by: Brian Tkatch | last post by:
I have a form with two DataGrids, which are kept in sync manually via Stored PROCEDURE calls. That is, when a record is selected on the first grid, a stored PROCEDURE is CALLed to Fill() the next...
1
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
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...

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.