Home All Groups Group Topic Archive Search About

Datagrid display problem

Author
10 Feb 2006 5:57 PM
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.

Author
10 Feb 2006 7:48 PM
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
Author
13 Feb 2006 2:46 PM
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?


Show quoteHide quote
"JJ" <a**@xyz.com> wrote in message
news:OeF7rtmLGHA.2336@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.
>
>
Author
13 Feb 2006 7:37 PM
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.


Show quoteHide quote
"JJ" <a**@xyz.com> wrote in message
news:Ox3lDxKMGHA.208@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" <a**@xyz.com> wrote in message
> news:OeF7rtmLGHA.2336@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.
>>
>>
>
>