We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Formatting multiple grids on one form

I have a bit of a strange one which should be easy to sort but is proving elusive. I have a form which has a tab control with three tabs and on each tab has a databound grid. Each grid is to be setup the same as each other but the only difference is the the data table that they point to. I have a sub routine which handles the formating as shown below (only a snapshot) The problem is that it only seems to setup the first grid but the other two remain as they are in design mode even though each call is made without error. Has anyone has had a similar problem? Private Sub SetupGrid() Dim oDBGrid As Syncfusion.Windows.Forms.Grid.GridDataBoundGrid For N As Integer = 1 To 3 Select Case N Case 1 oDBGrid = gridDBRetainer Case 1 oDBGrid = gridDBProject Case 3 oDBGrid = gridDBICincome End Select For I As Integer = 0 To oDBGrid.Model.Data.ColCount Select Case I Case 0 oDBGrid.Model.ColWidths.SetSize(I, 20) Case 1 oDBGrid.Model(0, I).Text = "Client" oDBGrid.Model(0, I).Font.Bold = True oDBGrid.Model.ColWidths.SetSize(I, 200) End Case Next Next

3 Replies

AD Administrator Syncfusion Team May 4, 2005 04:07 PM UTC

You might try calling oDBGrid.Refresh at the bottom of the loop on N to see if that makes things work.


AD Administrator Syncfusion Team May 4, 2005 04:19 PM UTC

Sorry, did have that in there. Like I mentioned, it''s only a snapshot of the full routine.


AD Administrator Syncfusion Team May 4, 2005 04:29 PM UTC

Would appear you need to flick to the respective tab before setting the format for that grid.

Loader.
Up arrow icon