How to overcome the Microsoft bug in datagrid?

  • Thread starter Thread starter Earl
  • Start date Start date
E

Earl

When I create and assign a new tablestyle to the datagrid (20 columns), then
scroll to the right, and then back to the left, I'm left with garbage in the
columns. This appears mostly as vertical lines slashing through the cell
contents. This issue has been posted both before and after VS2005 was
released but I've not seen any resolution. Does anyone have an answer?
 
I could not reproduce this issue. Is there anything special about your grid
or data source?

Do you see it on all devices? What about emulator? And which version of
NETCF are you using?



--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Thanks for replying Ilya. This is indeed a problem, and one I did not see in
VS2003. In essence, I call a webservice, then create a custom table style
and apply it to the grid. The webservice works fine, the data is all
present, the grid displays the data, and displays it with no problems
WITHOUT the custom table style. But once I create and apply the custom table
style, scrolling to the right, then back to the left, I have vertical lines
slashing through the cell contents. Here is the relevant code:

Private Sub TestService
Dim ds As DataSet = [calls a webservice dataset that contains a
single table]
dg.DataSource = ds.Tables(SampleDT)
AdjustTableStyle()
End Sub

Private Sub AdjustTableStyle()

dg.TableStyles.Clear()

Dim tblStyle As New DataGridTableStyle
tblStyle.MappingName = "SampleDT"

Dim tbc1 As New DataGridTextBoxColumn
tbc1.MappingName = "LongStatusName"
tbc1.HeaderText = "Status"
tbc1.Width = 80
tbc1.NullText = ""

' ... creating 22 columns

Dim tbc22 As New DataGridTextBoxColumn
tbc22.MappingName = "SampleSource"
tbc22.HeaderText = "Source"
tbc22.Width = 80
tbc22.NullText = ""

tblStyle.GridColumnStyles.Add(tbc1)

'... adding the other columnstyles

tblStyle.GridColumnStyles.Add(tbc22)

dg.TableStyles.Add(tblStyle)

End Sub
 
Back
Top