Grid Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ShadowUK
    No longer a forum member
    • Oct 2007
    • 1322

    Grid Question

    Is there any simple way to recreate a grid like how Dermot did in his XMDB demo, like this?



    I'm new to grid and some simple code would be appreciated.
  • HMMurdock
    Forum Member
    • Mar 2005
    • 144

    #2
    Are you just looking to populate a grid with results from a database query?

    I actually have a project similar to (actually, inspired by) Dermot's xMDB project that I'm working on now.

    It is designed to work with the SQLite plugin. Right now it has the same functionality as xMDB, but I'm working on adding a tree object so you can browse the tables/fields to add to your query.

    (this is basically a design tool for me to help me work with SQLite databases for other projects I'm working on)

    I'd be happy to share some code, or the whole project if you are interested.

    Comment

    • ShadowUK
      No longer a forum member
      • Oct 2007
      • 1322

      #3
      Actually, Just make it look like the image. Not using a database query.

      Comment

      • bule
        Indigo Rose Customer
        • May 2005
        • 1116

        #4
        You have to manually code the behavior of the grid.
        And believe it or not, you have to do it each time you enter the
        page because the silly thing resets itself each time (including the data).

        Code:
        function PrepareDataGrid(name)
        	-- prepare:
        	DataGrid.SetGridLines(name, false, false);
        	DataGrid.SetEditable(name, false);
        	DataGrid.SetListMode(name, true);
        	DataGrid.SetFrameFocusCell(name, false, false);
        	DataGrid.SetSingleRowSelection(name, true);
        	DataGrid.SetFixedColumnSelection(name, false);
        	DataGrid.SetToolTipsEnabled(name, true);
        	DataGrid.SetSelectable(name, true);
        	-- columns:
        	DataGrid.SetColumnCount(name, 5);
        	DataGrid.SetColumnWidth(name, 0, 25, false);
        	DataGrid.SetColumnWidth(name, 1, 45, false);
        	DataGrid.SetColumnWidth(name, 2, 145, false);
        	DataGrid.SetColumnWidth(name, 3, 60, false);
        	DataGrid.SetColumnWidth(name, 4, 60, false);
        	DataGrid.SetCellText(name, 0, 0, "Bla", false);
        	DataGrid.SetCellText(name, 0, 1, "Bla Bla", false);
        	DataGrid.SetCellText(name, 0, 2, "Obsolete way to design GUI", false);
        	DataGrid.SetCellText(name, 0, 3, "Blaaa", false);
        	DataGrid.SetCellText(name, 0, 4, "Borring", false);
        	-- finish:
        	DataGrid.ExpandColumnsToFit(name, true, true)
        end
        Never know what life is gonna throw at you. ZubTech

        Comment

        • ShadowUK
          No longer a forum member
          • Oct 2007
          • 1322

          #5
          Very nice.

          Comment

          Working...
          X