Hello,
I'm using iggrid with mvc helper which contains features as below
features.Sorting().Type(OpType.Remote).SortUrlKey("ColumnName").Mode(SortingMode.Single); features.Selection().Mode(SelectionMode.Row).Activation(true); features.Hiding().ColumnSettings(settings => settings.ColumnSetting().ColumnKey("SafetyStockLevel").Hidden(true).AllowHiding(true)); features.ColumnMoving().ColumnMovingDialogContainment("window"); features.Updating().EditMode(GridEditMode.None).EnableAddRow(false).EnableDeleteRow(false); features.AppendRowsOnDemand().LoadTrigger(LoadTrigger.Auto).Type(OpType.Remote).ChunkSize(6).ChunkSizeUrlKey("PageSize").ChunkIndexUrlKey("CurrentIndex");
I am using below code to add new row dynamically in grid
$(".selector").igGridUpdating("addRow", rowObj);
The new row is added but is always added at the last position in grid.
But i want to add the row in any position in grid , so is there ant method available to achieve this functionality ?
Thanks,
Vishal
Hello Vishal,
You can add a new row at a desired position using the following API method, which is part of the igDataSource API: http://www.igniteui.com/help/api/2016.2/ig.datasource. Please note that in order the new row to be properly rendered in the grid, you should rebind it. Here is a sample for your reference: http://jsfiddle.net/ig_mharrington/fuovszm0/
If you need further assistance, feel free to contact me.
Regards,
Tsanna
thanks for quick response but my question is
If i have total 10 records in my grid and i need to add one row at 7th position. we are updating & adding & deleting records using ui.iggridupdating
we do not want to refresh whole grid using data source, we need to add only that row which is new in data source. for that , we need to add that row of particular row location of data source.
ex. if we have total 10 record in grid , we bind new data from server with 11 record and the new record added 7th position in data source so that row should be add on 7 th position currently it will add into last location of grid using $("#Gridid").igGridUpdating("addRow", rowObj);
please help us.