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.
Vishal,
igGridUpdating addRow API does not provide the ability to add the new row at a desired position in the grid. That's why I suggested you to use insertRow API of the igDataSource. If you want to use the igGridUpdating API with similar functionality, then I you may suggest it as new product idea at: http://ideas.infragistics.com.
Steps to create your idea: 1. Log into the Infragistics Product Idea site at http://ideas.infragistics.com (creating a new login if needed).2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)3. Add your product idea and be sure to be specific and provide as much detail as possible. • Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!• [CASE: “Reference case [case number], FORUMS: “Include a link to this thread”] in your idea so product management will be able to look back at this case.
Please let me know if I may be of further assistance for you regarding this matter.