Datagrid display problem

J

JJ

I have a datagrid on my form that displays its data from various tables
within a specified dataset.
That all works correclty.

However, when one cell is selected prior to changed the displayed table, the
cell from the old table remains visible, infront of the new tables data...?!

I have tried 'datagrid.refresh', 'DataGrid1.DataSource = nothing' and all
sort of tricks to try and update the display, but to no avail. My code looks
like this to update the datagrid:

Private Sub PopulateGridWithTable2(ByVal Keyword As String, byVal Value as
int)

DataGrid1.DataSource = Table2

DataGrid1.Visible = True

Dim myDataColumn As DataColumn

Dim myDataRow As DataRow

myDataRow = Table2.NewRow()

myDataRow("Keyword") = Keyword

myDataRow("Value") = Value

Table2.Rows.Add(myDataRow)

DataGrid1.Refresh()

End Sub



If anyone can help - please post a quick reply. Its driving me nuts.
 
K

Kyjan

There have been various posts on the newsgroups concerning this. It's
a bug that's in the .NET Framework Service Pack 1. It has to do with
GridColumnStyles and the ReadOnly attribute from what I understand.

Some people have said that if you change ReadOnly to false before
updating the DataGrid that it will solve the problem; however, I have
not been able to solve the problem yet. I would also be interested to
hear what other people have on this.

Raymond
 
J

JJ

Can anyone help with this? I'm having a real problem getting the datagrid to
get rid of a cell in a table that has the cursor in it. Even when changing
the datasource to another table and displaying its cells, the previous cell
with the cursor in it remains displayed in front of any new tables.

Any suggestions?
 
J

JJ

I chose to avoid this problem by having a datagrid for each table. Not the
best solution I'm sure, but I could not think of any other simple way around
it.
 

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