473,665 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1772
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.SetFocu s() to return the focus to the textbox.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Gidi" <sh*****@hotmai l.com.dontspam> wrote in message
news:34******** *************** ***********@mic rosoft.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
1876
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 tablestyle and gridcolumnstyles to that tablestyle. If we have invisible columns, we add the gridcolumnstyle with Width = 0 (couldn't find any other way to do it, because there is no Visible property available...).
0
1670
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 with one of the scrolling displays which is implemented as a DataGrid with several custom DataGridColumnStyles. When the Form containing the DataGrid is made visible the initial rows of the DataGrid's DataView source display as one might expect....
1
4985
by: john sutor | last post by:
Does anyone know if you can display vertical scroll or horizontal scroll bars on the datagrid ???
0
1183
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 HorizontalOffset. This may not be available to me. While I can put code in the scroll event handler to perform when the event occurs, I really need to know how far its moving. I need to move things that I am drawing by hand with GDI+ based on how...
1
5287
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 the user doesn't have to scroll horizontally. Essentially, I want to wrap a datagrid row (not text in individual columns) with as much control as possible. Make sense? While this seems simple enough on the surface, I can't figure out how to do...
8
2400
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 text boxes whichmakes the user to SCROLL a lot. I need only these 2 cloumns to be displayed in Edit mode. Is that possible & how? 2. Also, even when the data grid is not displayed in the edit mode, it
1
2339
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 current cell to by: 'Get Screen Coorinate of Mouse Cursor Dim p As Point = New Point(dgrid.Parent.MousePosition.X,dgrid.Parent.MousePosition.Y) 'Convert Screen Coordinates to Local Coordinates Dim pC As Point = dgrid.PointToClient(p) 'Runs Hit...
0
1414
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 scroll bar. The same datagrid works with the wheel for vertical scrolling just fine. Is there something you have to do to catch the horizontal scroll events? Dan
3
2708
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 second DataGrid's DataSource. All that works very well. And, when there are no records to display, it is simply left blank. My issue is that when i scroll the first one, sometimes the second grid shows a bunch of null values (a "new" record). ...
1
1878
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 recessed it in a <Div></Divto allow scrolling of just the data, not the page. What I need to do is place a DataList (also in a <Div></Divto allow scrolling of just the data) to the right of the Datagrid to show 40 Employee Detail fields (listed top to...
0
8438
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...
1
8549
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
8636
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
7376
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...
1
6187
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
4186
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...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
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
2
2004
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.