Inline datagrid rowcreate

I am trying to insert a default value when I add a new row to an inline datagrid. the C# code i am inserting is ${kpi.KPI_StoreNo}=4675; which works when I use it in a CRUD form. I have tried inserting this code in several areas, but can't seem to find the right place to trigger it. Any help would be appreciated.

You can set the properties of the new item like this:

ordersGrid.InsertRow(new Order { KPI_StoreNo = 4675 });

Perfect! Thank you worked exactly like I needed!

Followup...this actually doesn't seem to be working..probably my error. Here is the exact C# code I used:

grid0.InsertRow(new KPI {KPI_Store_No = 4675});

KPI is the name of the Table. I get the following error

error CS0246: The type or namespace name 'KPI' could not be found (are you missing a using directive or an assembly reference?)

I guess I'm lost on the namespace part of this...I have tried several different iterations...nothing seems to work...probably a stupid mistake.

Check the generated code for the KPI class. Then use its fully qualified type name when instantiating a new instance e.g.

grid0.InsertRow(new MyApplication.Models.MyDataSource.KPI {KPI_Store_No = 4675});

Followup on that...Thank you ...no longer generates an error. But I must be putting it in the wrong event.

I have put this code in the RowCreate event of the datagrid. It still does not update the row with the value.

Sorry for the newbie questions...

Followup. It is loading the value, but I doesn't display it until I click the save button. So the table is updating but the grid is not until I save.

You need to add this code in the Click handler of the Add button. RowCreate is fired when the user saves a new item.

Yup...stupid question...thank you for the help!