Metastorm 9: Add New Record (Non-Editable Grid)

Apr 23rd, 2010 | Filed under Metastorm 9, Metastorm 9 Designer
Tweet this

The setup is, you have a form with a non-editable grid and fields to collect the data to be entered into the grid.

Grid Name: GridTest

Business Object: TestGrid

Button to Add Record: “Add” – Server side button with Code Activity

Code Activity:

System.Data.DataSet ds = TestGrid.Read();
System.Data.DataRow dr = ds.Tables[0].NewRow();

 dr["FIRST_COLUMN"] = “FIRST COLUMN DATA”;
 dr["SECOND_COLUMN"] = “SECOND COLUMN DATA”;
 ds.Tables[0].Rows.Add(dr);

//write changes to Business Object
TestGrid.Write(ds);
TestGrid.CurrentIndex = (TestGrid.Count-1);

This method will add a record to a non-editable grid and refresh the grid to reflect the change.

Buzz it!
Rating 3.00 out of 5
[?]
No comments yet.