473,503 Members | 13,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

irritatiing datagrid bug

guy
using VS 2003
create a winforms app
add a datagrid to the form
and bind it to a an arraylist or similar
in the click event of the datagrid pop up a message box
run the app
click on the separator between rows (when you have the double headed
vertical arrow cursor)
the message box pops up but the mouse is trapped within the grid borders!

code below:-

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim a As New ArrayList
a.Add(1)
a.Add(2)
a.Add(3)
Me.DataGrid1.DataSource = a
End Sub
Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.Click
MsgBox("oops", MsgBoxStyle.OKOnly)
End Sub
Nov 21 '05 #1
2 1050
But you make a click within the Datagrid, don't you?
Not in the grid area but still within the data grid. You might do a hittest
to see if your in any cell and act upon the result of that.

HTH
/Kejpa

"guy" <gu*@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
using VS 2003
create a winforms app
add a datagrid to the form
and bind it to a an arraylist or similar
in the click event of the datagrid pop up a message box
run the app
click on the separator between rows (when you have the double headed
vertical arrow cursor)
the message box pops up but the mouse is trapped within the grid borders!

code below:-

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim a As New ArrayList
a.Add(1)
a.Add(2)
a.Add(3)
Me.DataGrid1.DataSource = a
End Sub
Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.Click
MsgBox("oops", MsgBoxStyle.OKOnly)
End Sub

Nov 21 '05 #2
Try this and see if your bug replicates

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Debug.WriteLine(Me.ComboBox1.Text & " " & Me.ComboBox1.SelectedValue)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim arrPerson As New ArrayList()

arrPerson.Add(New Person("1", "11"))
arrPerson.Add(New Person("2", "22"))
arrPerson.Add(New Person("3", "33"))
arrPerson.Add(New Person("4", "44"))

Me.ComboBox1.DataSource = arrPerson
Me.ComboBox1.DisplayMember = "Name"
Me.ComboBox1.ValueMember = "ID"

Me.DataGrid1.DataSource = arrPerson
End Sub

Public Class Person

Private _Name As String
Private _ID As String

Public Sub New(ByVal strName As String, ByVal strID As String)
MyBase.New()
Me._Name = strName
Me._ID = strID
End Sub

Public ReadOnly Property Name() As String
Get
Return _Name
End Get
End Property

Public ReadOnly Property ID() As String
Get
Return _ID
End Get
End Property

End Class

"guy" <gu*@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com:
using VS 2003
create a winforms app
add a datagrid to the form
and bind it to a an arraylist or similar
in the click event of the datagrid pop up a message box
run the app
click on the separator between rows (when you have the double headed
vertical arrow cursor)
the message box pops up but the mouse is trapped within the grid
borders!

code below:-

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim a As New ArrayList
a.Add(1)
a.Add(2)
a.Add(3)
Me.DataGrid1.DataSource = a
End Sub
Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.Click
MsgBox("oops", MsgBoxStyle.OKOnly)
End Sub


Nov 21 '05 #3

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

Similar topics

8
7886
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
3
4236
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
5
9165
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...
2
4316
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
0
1650
by: mgenti | last post by:
I am experiencing a problem when I add a row to a DataTable that is used on a DataGrid in my Windows Form application. When I add a new row I no longer get a response from my form. I see the row...
2
3107
by: Scott | last post by:
Hi all. A few days ago i ask this question and got a good quick response. I tried out what they said and it worked. However I have now come to try the same thing in another program and it...
1
4280
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
2
6374
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
7
5656
by: Dave | last post by:
Are there any add-on products or samples available that can do the following in an vb.net datagrid I want to compare 2 rows in a datagrid - one row from one database and another row for another...
0
7213
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
7098
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
7366
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...
1
7017
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
7471
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
5610
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,...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
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 ...
0
406
bsmnconsultancy
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...

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.