473,395 Members | 1,675 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,395 software developers and data experts.

Data Grid Class & Currency manager

Hi,
Hi had a DataGrid on a form and was using the CurrentCellChanged Event to
determine the selected row:
Private Sub grdSelOrd_CurrentCellChanged(ByVal sender As System.Object, _

ByVal e As System.EventArgs)

dacGetDataGridRow()

Dim intRow As Integer = CType(Me.BindingContext(grdSelOrd.DataSource), _

CurrencyManager).Position

..............

End Sub

This worked fine but I needed to prevent some columns from sorting the Data
Grid so I created a new class "CustomDGrid" and used the event
Protected Overrides Sub OnMouseDown(ByVal e As
System.Windows.Forms.MouseEventArgs)

to compare the column against a passed parameter testing columns to sort.

This also worked fine along with event handlers:

With grdSelOrd

..Top = 104

..Left = 16

..Height = 500

..Width = 911

..Anchor = AnchorStyles.Top Or AnchorStyles.Bottom Or AnchorStyles.Left Or
AnchorStyles.Right

..Name = "grdSelOrd"

..TabIndex = 0

..SortCols = "0,1,2,6"

End With

Controls.Add(grdSelOrd)

' Associate an event handler with an event.

AddHandler grdSelOrd.CurrentCellChanged, AddressOf
grdSelOrd_CurrentCellChanged

AddHandler grdSelOrd.DoubleClick, AddressOf grdSelOrd_DoubleClick

AddHandler grdSelOrd.Click, AddressOf grdSelOrd_Click

But I now can not get the code I used to test for the selected row to work.

Could someone explain to me what I need to get the currency manager
reporting the current row back in the Form's class?
Nov 21 '05 #1
1 1334
Solved this,
It wasn't a Currency manager Issue but poor debugging, Clicking on a cell
was being treated as if it was a "NoSort" Column.

Sorry!
Doug

"Doug Bell" <Po*********@vodaphone.com.au> wrote in message
news:Ob*************@TK2MSFTNGP09.phx.gbl...
Hi,
Hi had a DataGrid on a form and was using the CurrentCellChanged Event to
determine the selected row:
Private Sub grdSelOrd_CurrentCellChanged(ByVal sender As System.Object, _

ByVal e As System.EventArgs)

dacGetDataGridRow()

Dim intRow As Integer = CType(Me.BindingContext(grdSelOrd.DataSource), _

CurrencyManager).Position

.............

End Sub

This worked fine but I needed to prevent some columns from sorting the Data Grid so I created a new class "CustomDGrid" and used the event
Protected Overrides Sub OnMouseDown(ByVal e As
System.Windows.Forms.MouseEventArgs)

to compare the column against a passed parameter testing columns to sort.

This also worked fine along with event handlers:

With grdSelOrd

.Top = 104

.Left = 16

.Height = 500

.Width = 911

.Anchor = AnchorStyles.Top Or AnchorStyles.Bottom Or AnchorStyles.Left Or
AnchorStyles.Right

.Name = "grdSelOrd"

.TabIndex = 0

.SortCols = "0,1,2,6"

End With

Controls.Add(grdSelOrd)

' Associate an event handler with an event.

AddHandler grdSelOrd.CurrentCellChanged, AddressOf
grdSelOrd_CurrentCellChanged

AddHandler grdSelOrd.DoubleClick, AddressOf grdSelOrd_DoubleClick

AddHandler grdSelOrd.Click, AddressOf grdSelOrd_Click

But I now can not get the code I used to test for the selected row to work.
Could someone explain to me what I need to get the currency manager
reporting the current row back in the Form's class?

Nov 21 '05 #2

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

Similar topics

3
by: Chris | last post by:
Could someone please provide me an effective means of exporting data from a data set (or data grid) to Excel?
0
by: TheCoder | last post by:
I am making a D-base with web conectivity for my class project. I have everything working but the subit button sends the data to the correct fields but afterwards it wants to reproduce new blank...
2
by: Christopher Weaver | last post by:
I have a DataSet with two tables and a DataRelation. When I populate the DataSet and define a master detail relationship through the DataRelation, the grid bound to the master table shows both...
4
by: Jack M | last post by:
I have a large data grid with several rows that contain dates. I want to display the date only(no time). Even when I use the trunc function in Oracle the rows show a time of 12:00:00 am. What I...
12
by: Ramesh | last post by:
Hi, Pls. answer to this question? Does the position change of the currency manager affect the Dataset. Since I wanted to use the HasChanges method of the dataset to check whether is there any...
2
by: Beemer Biker | last post by:
Cant believe I spent 4 hours trying to figure out why only the first grid in my new multiview shows up and the other grids are invisible in the other views I just added. The database tables were...
2
by: firstexact | last post by:
Hi guys, First post, hope you can help, I have done two sites www.trisant.co.uk and my own www.firstexact.co.uk. The 2 x 2 grid I originally envisaged goes haywire in Firefox as I get a 4 high by...
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
1
by: Francesco Bochicchio | last post by:
Il Mon, 18 Aug 2008 12:15:10 +0100, dudeja.rajat ha scritto: Uhm, I don't think you should use the grid manager to obtain a window like that. The grid manager is for equally distributing...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
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...
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...

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.