473,395 Members | 1,516 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.

datagrid isselected

Hello,
I use the mouseup event to select a row in a forms datagrid (using the
hittest info).
I also want to deselect a previously selected row. I thought I use
row.isselected, but thats false!??!?
In other events isselected works fine, but not in the mouseup event?
Strange or is this by design or did I do something wrong?
Below the code.
Thanks
Frank
Private Sub dgClicked(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles dgAlles.MouseUp, dgSel.MouseUp

Dim dg As DataGrid = CType(sender, DataGrid)

Dim pt As System.Drawing.Point = dg.PointToClient(Cursor.Position)

Dim hti As DataGrid.HitTestInfo = dg.HitTest(pt)

If hti.Type = DataGrid.HitTestType.Cell Then

If dg.IsSelected(hti.Row) Then

dg.UnSelect(hti.Row)

Else

dg.CurrentCell = New DataGridCell(hti.Row, hti.Column)

dg.Select(hti.Row)

End If

End If

End Sub


Nov 21 '05 #1
0 899

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

Similar topics

2
by: Tom | last post by:
Hi, I have been through all kinds of documentation on the datagrid and dataviews. I have many expensive books that I have looked through. But nothing has really helped. I want to find out and...
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
1
by: thomaz | last post by:
Hi again... There is a DataGrid method or any way (like Foreach) to cover only the 10 or 20 selected lines in a DataGrid with 3000 lines??? Thanks....
6
by: Agnes | last post by:
I understand it is impossible, but still curious to know "Can I freeze several column in the datagrid, the user can only scroll the first 3 columns (not verical), for the rest of the coulumn, it is...
1
by: Jon | last post by:
Question: does datagrid1.isSelected(i) point to the same row as datatable.row(i).delete after datagrid sorted?? I am using datagrid1.isSelected(i) to identify datatable rows that have been...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
0
by: frostbb | last post by:
Ok, We've got a bunch of apps that we've migrated from Net 1.0 to Net 2.0. The apps were basically upgraded using the VS2005 migrate. The user control that was using a DataGrid.IsSelected(i)...
2
by: frostbb | last post by:
The following code works great in C# Net 1.0 & Net 1.1 apps ... doesn't work for Net 2.0 apps. Cannot get pDg.IsSelected(i) to toggle to 'true' for 'highlighted' rows in a DataGrid control. ...
0
by: frostbb | last post by:
1st I know about the new DataGridView control. For various reasons we need the IsSelected( ) method of the old DataGrid to work in the upgraded apps. I have a small test app that illustrates the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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
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.