views:

2444

answers:

3

Hello

I successfully installed the latest QuantumGrid from DevExpress, but I've never worked with this grid before, and I don't know how to get started. I find that the HLP file isn't really a tutorial, and the demos are so rich to the point where I can't get started quickly and see if QuantumGrid fits my needs.

Would someone happen to have a really basic example on how to create a small, non-DB-bound, non-hierarchized, but user-editable grid to host a couple of columns and fill the grid with a few rows?

Thank you.

+4  A: 

Place a grid on a form, then delete its default GridView and add a TableView. Add a few columns to TableView and then associate your GridLevel with this new view. Place a button on form and add this code to its click handler.

cxGrid1TableView1.DataController.BeginFullUpdate;
try
  cxGrid1TableView1.DataController.RecordCount := 3;
  cxGrid1TableView1.DataController.SetValue(0,0,'Data1');
  cxGrid1TableView1.DataController.SetValue(1,0,'Data2');
  cxGrid1TableView1.DataController.SetValue(2,0,'Data3');
finally
  cxGrid1TableView1.DataController.EndFullUpdate;
end;

RecordIndex corresponds to the row index and ItemIndex corresponds to the column index. I hope this helps you to get started.

idursun
+2  A: 
  1. Create a table view(gridlevel->create view->table)
  2. Create columns(double click cxgrid and add)
  3. Set property(inner controls like DateEdit) if you want. default property is textedit)
  4. You can insert/delete via TableView.DataController.Insert/TableView.DataController.Delete* or use navigator(View->OptionsView->Navigator)

You should look at demos("quantumgrid directory"\Demos\Delphi), demos are more helpful than help files :)

barism
A: 

Thanks guys for the help. For those interested in getting started with this grid object, here (what I think) are the steps presented above:

(idursun)

  1. Add a TcxGrid object to the form

  2. In the Structure object in the IDE, right-click on cxGrid1, and select "Delete View"

  3. Right-click on cxGrid1, and select "Editor"

  4. Click on the "Views" tab, click on "Add View...", and select "Table" in the drop-down list

  5. In the "Columns" tab on the right, click on "Add", and add a few columns

  6. Still in this dialog box, go back to the "Structure" tab on the left

  7. Right-click on cxGridLevel1, and choose "Select View" to associate the Level with this new TableView. Close the dialog

  8. In the form, add a button, and paste this code to its Click event:

    cxGrid1TableView1.DataController.BeginFullUpdate; try cxGrid1TableView1.DataController.RecordCount := 3; cxGrid1TableView1.DataController.SetValue(0,0,'Data1'); cxGrid1TableView1.DataController.SetValue(1,0,'Data2'); cxGrid1TableView1.DataController.SetValue(2,0,'Data3'); finally cxGrid1TableView1.DataController.EndFullUpdate; end;

(barism)

  1. Add a TxGrid object to the form

  2. Within this new cxGrid1 object in the form, right-click its cxGrid1Level object, and select "Create View > Table"

  3. In the Structure object in the IDE, right-click on cxGrid1, and select "Editor..."

  4. In the Columns tab on the right, click on Add to add a couple of columns. Close this dialog

  5. To add data to the grid, either write code, or right-click on cxGrid1 and select "Edit Layout and Data"

OverTheRainbow