I want to select a row from my igGrid and when submit button is clicked, I want that entire row to be passed down to the action method of the submit button. How can I do that ?
I have set features.Selection().Mode(SelectionMode.Row);
Is there a way to pass the entire row which was seleected to the action method or could i atleast get the id of the row selected.
Also is there a way other than using Jquery, Is there a .feature=> property through which we can pass the row or row id on button click. If not then please tell me how to do it through Jquery.
I need to know this urgently. Any help would be appreciated. also I have read the IgnitUi's website demo but still i cannot seem to achieve what i want .
If you could provide a short working sample , that would be great.
Thanks.
Hello zeppelin led,
Thank you for posting in our forums!
If you are submitting a form, you can pass the selected row's rowId through a hidden input. You can handle the rowSelectionChanged event to set the value of the hidden input. You can then use this id to get the rest of the row's data you may need on the server. Please see my attached sample for a demonstration of this.
You can find more information on the rowSelectionChanged event in our documentation here:
https://www.igniteui.com/help/api/2014.1/ui.iggridselection#events
If you have any further questions or concerns with this, please let me know.
Hello ,
Earlier I wrote the code of Grid in my View (.cshtml) file and there i registered the rowSelectionChanged Client Event like this ->
In View (.cshtml)
.Features(features => { features.Selection().Mode(SelectionMode.Row).AddClientEvent("rowSelectionChanged", "rowSelectionChangedHandler"); ; })
NOW I have shifted all my grid code to the Controller and I am adding features of the grid in the cotroller's GridModel. I am making the grid model like this->
In Controller(.cs)
gridModel.Features.Add(new GridTooltips()); gridModel.Features.Add(new GridFiltering() { Type = OpType.Remote, Inherit = true}); gridModel.Features.Add(new GridSorting() { Type = OpType.Remote, Inherit = true }); gridModel.Features.Add(new GridPaging() { Type = OpType.Remote, Inherit = true, PageSize = 5 ,CurrentPageIndex=0,TotalRecordsCount=20 }); gridModel.Features.Add(new GridSelection() { Mode = SelectionMode.Row });
// How can i register the rowSelectionChanged Client Event to my "rowSelectionChangedHandler" in my controller file.
please if you could show me the code snippet that does that that would really help.
Use the ClientEvents property of the feature. Here is an example:
Hope this helps,Martin PavlovInfragistics, Inc.
Hi Team,
If I want to find the cell text on selected row event based on column name, is it possible?
Thanks again. Really appreciate your help.
For each child layout you should add UpdateUrl which points to an action method which will handle the transactions for this specific layout. This is needed, because GridModel.LoadTransactions is generic method and requires a generic type parameter, so for ScreenType type you'll call
or for Screen you'll call
In the browser you need to call igGrid.saveChanges for each grid. This is done by iterating over the collection returned by igHierarchicalGrid.allChildrenWidgets (for the root grid you need to use igHierarchicalGrid.rootWidget).
Here is an example:
Can you please help me with this case :
CAS-137660-J4X4H9
QUERY:
Thread: http://es.infragistics.com/community/forums/t/89780.aspx
I came across another issue, I want to enable editing in the lowest level of the model i.e the screen model and update it.
I specify the UpdateUrl at the end of the grid like this;
UpdateUrl(Url.Action("UpdateRoleRights")).AutoCommit(true)
Now when I modify the screen model (which is the lowest level of the model) and the update method is called I don't seem to get anything from the transactions;
List<Transaction<RoleRightsModel>> transactions = gridModel.LoadTransactions<RoleRightsModel>(HttpContext.Request.Form["ig_transactions"]);
But if I edit the top most level of the mode i.e the RoleRightsModel, I can get the transactions. How can I access the updated rows from the lowest level of the hierarchy? Thanks in advance.
That worked. thanks alot!