ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum no longer accepts new user registrations, please report your question, problem and feedback to the issue page of ReoGrid on Github. Thanks for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-03-31 12:54:46

asparatu
Member
Registered: 2014-08-20
Posts: 196

Loading a rgf issue

Hello Jing,
   I have weird bug that happens. I have made 5 grid files in the editor they look fine in editor and load fine in the editor. So, i am loading in the my application the first two load just fine no problem, the second two load but they are load what looks like indent like 2 cells. if click on one of them it takes and snap into place the other do not. To get around this i have put the freezetocell to first row and 1 column and set to top and it work it but one still half cell off.

The code i use to load them all the same, which why can not understand why the first load just fine and the other do not.

I use this in a tabcontrol and I use the grid in other forms and which all have tabcontrols, but the only difference i am creating all the sheet in code. this first time i am doing in the editor and loading and then changing what i need to make work the way i want it to.

This the cold i use to load the files and set the setting of the grid

Shane

 Private Sub SetDefaultSheetSetting(layout As String, book As ReoGridControl, sheet As Worksheet, width As Integer, height As Integer,
                                       selectionMode As WorksheetSelectionMode)
        'Sets the workbook setting
        With book
            'Disables the tabcontrol and scrollbars
            .DisableSettings(WorkbookSettings.View_ShowScrolls Or WorkbookSettings.View_ShowSheetTabControl)

            'Disables the ScrollEndSpacing
            .ShowScrollEndSpacing = False

            'Sets the size of the workbook
            .Width = width
            .Height = height
        End With

        'sets the worksheet setting
        With sheet
            .Reset()

            Using ms As System.IO.MemoryStream = New System.IO.MemoryStream(System.Text.Encoding.Default.GetBytes(UI.ResourceManager.GetString(layout)))
                .LoadRGF(ms)
            End Using

            'Sets the selection mode of the sheet
            .SelectionMode = selectionMode
            .SelectionStyle = WorksheetSelectionStyle.Default

            'Disables
            .DisableSettings(WorksheetSettings.View_ShowRowHeader Or WorksheetSettings.View_ShowColumnHeader Or
                        WorksheetSettings.Edit_DragSelectionToMoveCells Or WorksheetSettings.Edit_DragSelectionToFillSerial Or
                        WorksheetSettings.View_ShowGridLine Or WorksheetSettings.View_ShowFrozenLine)

            'Freeze to the top row on of the sheet
            '.FreezeToCell(1, 1, FreezeArea.LeftTop)
        End With
    End Sub

This basically the same code for all the grids also

  Private Sub SetComponentListWorkSheet()
        'Sets the workbook and worksheet setting
        Call SetDefaultSheetSetting("ComponentListWorkBook", rgComponentListBook, rgComponentListSheet, 361, 261, WorksheetSelectionMode.Range)

        'sets the worksheet setting
        With rgComponentListSheet
            'Sets the header values
            .SetCellData("A1", UI.ComponentListTitle)
            .SetCellData("A2", UI.LikelihoodTitle)
            .SetCellData("B2", UI.ComponentListTitle)

            'Sets the valid range of the worksheet
            rgComponentListSheetValidRange = New RangePosition("B3", "B10")

            'Sets the selection range of the validrange
            .SelectionRange = New RangePosition(rgComponentListSheetValidRange.StartPos)

            'Sets the workbook flag
            m_blnCLWSFlag = True
        End With
    End Sub

This is the same every time i load the form
396cb6f1e74d3f7a7d7201ae597fff1c.png

When i do not use freezetocell property
Before i click or move to another page
be153acc43493036d90fb002b4001ee5.png

Click on validrange for that sheet on doing that it will snap into place
See the first grid goes into snap back into place and the second does not
2c64d4a5b16bb000c3ad4f98ef818a63.png

Fifth one does the same thing
eaf8eae0fd6797daa99593f4444fe879.png

If uses freezetocell property
still does not look right
2ab60a5282b76ca44d62e5e417dad56d.png

d4a62427187b43521425368676cf9eec.png

Offline

#2 2016-03-31 16:17:10

asparatu
Member
Registered: 2014-08-20
Posts: 196

Re: Loading a rgf issue

Hello Jing,
  After some testing i found out what the issue was. I changed the control to 1.2.1.0 things that was problem but was not it happen that version, so then took deleted the tabcontrol and added another one. like before the first page everthing was fine and on the second page it did the same thing.. I took and made an new sheet in code and i had the same results, so i removed all the disablesetting properties, and it work like was suppose to work. I set the  WorkbookSettings.View_ShowSheetTabControl to disable, then disable WorksheetSettings.View_ShowRowHeader and WorksheetSettings.View_ShowColumnHeader, still everything was ok, then i disabled WorkbookSettings.View_ShowScrolls and after disable showscrolls is where it happened.

I also tried in another form and like this one it works fine on first tabpage and anyone after that does not look ok. What i can do get this to work.. now.. is make all them panels and cycle through the panels and make visible and invisible.. I really dont want to do that..

e02e22e058034cb23eea0fd96e6def61.png

Looks like it just removed the everything but didn't resize correctly.
If freezetocell kind of works

        'Sets the workbook setting
        With rgBallparkReadingsBook
            'Disables the tabcontrol and scrollbars
            .SetSettings(WorkbookSettings.View_ShowSheetTabControl Or WorkbookSettings.View_ShowScrolls, False)
            'Or WorkbookSettings.View_ShowSheetTabControl, False)
            'Sets the size of the workbook
            .Width = 561
            .Height = 197
            .Location = New Point(17, 35)
        End With

        'sets the worksheet setting
        With rgBallparkReadingsSheet
            .Reset()

            'Sets the workbook size
            .SetRows(8)
            .SetCols(6)

            'Disables
            .SetSettings(WorksheetSettings.View_ShowColumnHeader Or WorksheetSettings.View_ShowRowHeader, False)
            '  .SetSettings(WorksheetSettings.View_ShowRowHeader Or WorksheetSettings.View_ShowColumnHeader Or
            '           WorksheetSettings.Edit_DragSelectionToMoveCells Or WorksheetSettings.Edit_DragSelectionToFillSerial Or
            '            WorksheetSettings.View_ShowGridLine Or WorksheetSettings.View_ShowFrozenLine, False)

            'Sets Border for Range
            .SetRangeBorders(RangePosition.EntireRange, BorderPositions.All,
                             New RangeBorderStyle() With {.Color = SigmaAid.Drawing.Color.UI.Border,
                                                           .Style = BorderLineStyle.Solid})
            'Sets the default setting for the control
            .SetRangeStyles(RangePosition.EntireRange,
                            New WorksheetRangeStyle() With {.Flag = PlainStyleFlag.BackColor Or PlainStyleFlag.FontAll Or PlainStyleFlag.TextColor,
                                                            .BackColor = SigmaAid.Drawing.Color.UI.Backcolor.NonSelectCell,
                                                            .TextColor = SigmaAid.Drawing.Color.UI.Forecolor.NonSelectCell,
                                                            .FontName = SigmaAid.Drawing.Font.MicrosoftJhengHeiUI.Name,
                                                            .FontSize = SigmaAid.Drawing.Font.Size.Nine})


            '  .FreezeToCell(1, 1, FreezeArea.Top)

            'sets the worksheet setting
            .SetCellData("A1", UI.InitialReadingsTitle)
            .SetCellData("A3", UI.InitialReadingsTitle)
            .SetCellData("A5", UI.After1stDisOrReassemblyTitle)
            .SetCellData("A7", UI.After2ndDisOrReassemblyTitle)
            .SetCellData("E2", UI.ReadingsTitle)
            .SetCellData("F2", UI.DftTitle)

            'Sets the valid range of the worksheet
            'rgBallparkReadingsSheetValidRange = New RangePosition("E3", "E8")

            ''Sets the selection range of the validrange
            '.SelectionRange = New RangePosition(rgBallparkReadingsSheetValidRange.StartPos)
        End With

Hope that helps you..

What i still dont understand why it work on the first page and not another and it works fine on the forms.
Shane

Last edited by asparatu (2016-03-31 16:58:20)

Offline

#3 2016-04-01 01:33:45

Jing
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Loading a rgf issue

Hi Shane, try the latest version 1.2.3: https://reogrid.net/download

Offline

#4 2016-04-01 03:19:24

asparatu
Member
Registered: 2014-08-20
Posts: 196

Re: Loading a rgf issue

Hello Jing,
  I will try it.. If not working, i made strip down version of the solution i am using.. Test Application

Shane

Offline

#5 2016-04-01 03:37:21

asparatu
Member
Registered: 2014-08-20
Posts: 196

Re: Loading a rgf issue

Hello Jing,
   I just tested in the test application and it work fine.. Thank you.. You fixed the bug before i gave to you lol That was driving me insane last night trying to understand why it want working right and finding out what the problem was.. bright side gave me quick crash course in C#, since the test solutions is all in C#, I see i need to learn C# now.. i like coding in it..

Shane

Last edited by asparatu (2016-04-01 03:40:32)

Offline

#6 2016-04-03 01:10:22

Jing
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Loading a rgf issue

You're welcome Shane, thanks for your bug reports!

Offline

#7 2016-04-14 10:59:03

Jing
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Loading a rgf issue

Offline

#8 2016-05-26 14:27:19

Jing
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Loading a rgf issue

This problem has been fixed in version 1.3, the download available at https://reogrid.net/download

Thanks for report!

Offline

Board footer

Powered by FluxBB