By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,556 Members | 1,456 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,556 IT Pros & Developers. It's quick & easy.

Datagrid display problem

P: n/a
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.
Feb 10 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

Feb 10 '06 #2

P: n/a
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?
"JJ" <ab*@xyz.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...
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.

Feb 13 '06 #3

P: n/a
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.
"JJ" <ab*@xyz.com> wrote in message
news:Ox*************@tk2msftngp13.phx.gbl...
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?
"JJ" <ab*@xyz.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...
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.


Feb 13 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.