I want to know how to scroll a DataGrid so that a specific row index will be
visible to the user? 5 13288
Us the CurrentRowIndex member to set the row you want visible.
"MrNobody" <Mr******@discu ssions.microsof t.com> wrote in message
news:22******** *************** ***********@mic rosoft.com... I want to know how to scroll a DataGrid so that a specific row index will be visible to the user?
Hi,
I'm trying to do auto scroll for my DataGrid, but each absolution I find
steal the focus to the DataGrid.
I also tried your suggestion using the CurrentRowIndex , but it also steals
the focus.
See my post regarding the other solution I tried: http://msdn.microsoft.com/newsgroups...d-84a7b701329b
Can you tell how to do auto scrolling without stealing the focus?
--
Thanks
Sharon
Hi Sharon,
Thanks for your post.
I am not sure why SendMessage does not work for you. As we negotiated in
the original post, this solution should work for you.(Actually, it works
well on my side.) If not, can you show me a little sample to demonstrate
the problem?
Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
I have this ElementsDataGri d class which is in ElementList class:
public class ElementList : System.Windows. Forms.UserContr ol
{
private class ElementsDataGri d : System.Windows. Forms.DataGrid
{
internal void ScrollToRow(int aRowNum)
{
this.GridVScrol led(this, new
ScrollEventArgs (ScrollEventTyp e.LargeIncremen t, aRowNum));
}
}
private bool m_autoScroll;
private InfraControls.E lementList.Elem entsDataGrid m_DataGrid;
[Description("De termines whether the grid will scroll down when a new row
is added."),
Category("Layou t")]
public override bool AutoScroll
{
get { return m_autoScroll; }
set { m_autoScroll = value; }
}
public void SetDataSource(D ataView data)
{
m_DataGrid.Data Source = data;
data.AllowNew = false;
}
private void DoAutoScroll()
{
if( m_autoScroll )
{
m_DataGrid.Scro llToRow((m_Data Grid.DataSource as DataView).Count-1);
}
}
private void AddDefects(obje ct aSender, ArrayList aDefectRows)
{
DoAutoScroll();
}
}
Defects are added to the DataSet, causing the ElementsDataGri d to be added
with more rows and invoking the AddDefects() that invoke the DoAutoScroll().
And the DoAutoScroll() is invoked causing the vertical scrollbar of the
ElementsDataGri d to move --> the focus is taken to the ElementsDataGri d. And
this is the problem I wish to avoid.
The code is larger then what I have posted in here, I couldn’t post all of
it in here (much too much). I hope this post can help resolving this problem.
-----
Thanks
Sharon This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Bill Sonia |
last post by:
It seems whenever I set a DataGrid.DataSource = DataTable
(vb.net) to populate a datagrid, the scroll bars on the
datagrid default to disabled. And the only way I can get
them to enable is to manually resize a column width with
the mouse (not very elegant).
Anyone have any ideas how I could enable the datagrid
scroll bars in my code?
Thanks,
|
by: GrantS |
last post by:
I am trying to convert the VB.Net code example povided by
http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx
into C# (ASP.Net)without success. No errors are thrown in the VB code
provided on the website.
Once I have this example running correctly, I will need to use the
concept in a more complex project. The code I am using involves an
webform and an htc file.
The code for ScrollPos.htc (which is located in a folder...
|
by: Boaz Ben-Porat |
last post by:
Hi all
Is there a way to simulate a click on a scrollbar (horizontal) of a FataGrid
?
I need to programmatically scroll the grid to the right/left upon some
condition, when the total width of the grid columns is greater then the
grid`s rectangle.
TIA
|
by: Gidi |
last post by:
hello
i have a DataGrid table and by the help of Adnan, here in the forum, i have the Mouse_up Event that by Clicking a row on the dataGrid it's selectes the whole ro
the problem is when i'm pressing the scroll arrows (to move the rows up\down\left\right) the whole stays selected except the cell which i pressed
how can i prevent that from hapenning
here with the Mouse_Up method
private void dataGrid1_MouseUp(object sender,...
|
by: tshad |
last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is
filled?
I have a bunch of DataGrids that get displayed nested inside a DataList.
The datagrid looks like:
*******************************************************************************
<asp:DataGrid visible="False"
border=1
| |
by: simchajoy2000 |
last post by:
Hi,
I have a form containing a datagrid where users can enter in their
specified information for each row and column. Behind the scenes I
have a sub which handles datagrid.CurrentCellChanged because I need to
be able to execute some code whenever a user clicks in a different
cell of the datagrid. Inside this sub I place the datagrid.datasource
into a data table so that I can work with it's contents. However, I
am getting "Out of...
|
by: jeguillo |
last post by:
I am trying to retrieve the text within each cell in a datagrid in
order to change the color of each cell, depending on the value within
that cell.
This works fine on the cells that are bound columns, but returns an
empty string for the cells that are hyperlink columns.
Here is the code to retrive the text:
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
|
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 -
|
by: JamesOo |
last post by:
I have the code below, but I need to make it searchable in query table,
below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only, cannot serch by combine 3 table)
Example I have the query table below, how do I make the code to seach based on the query from this:
SELECT Product.ID, Product.Description, Quantity.Quantity, Quantity.SeialNo, Quantity.SupplierID,...
|
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...
|
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...
| |
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,...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |