Reproducible DataGrid problem

G

Guest

VS.NET 2003 , .Net Framework 1.1 SP1

Create a new WinForms project with one form.
on the form place a DataGrid and a TextBox.
(Just use the default names)

add the following code:-

Private al As New ArrayList

Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim i As Integer
DataGrid1.DataSource = al
DataGrid1.DataBindings.Clear()
Dim a As New ArrayList
DataGrid1.DataSource = a
DataGrid1.DataBindings.Clear()
Dim s1 As String = "one"
Dim s2 As String = "two"
Dim s3 As String = "three"
al.Add(s1)
al.Add(s2)
al.Add(s3)
DataGrid1.DataSource = al
End Sub

run the application and then click in the text box.
How do I supress the dialogue?

not e that the dummy bind in the middle is tpo froce a refresh otherwise the
data never displays.

help!
 
G

Guest

hmm, if a add the line *** below it works, any idea wahts going on?

Dim i As Integer
DataGrid1.DataSource = al
DataGrid1.DataBindings.Clear()
Dim a As New ArrayList
DataGrid1.DataSource = a
DataGrid1.DataBindings.Clear()
*** al = New ArrayList ***
Dim s1 As String = "one"
Dim s2 As String = "two"
Dim s3 As String = "three"
al.Add(s1)
al.Add(s2)
al.Add(s3)
DataGrid1.DataSource = al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top