Hi,
We are facing multiple issues with Manual CRUD for Multilevel Hierarachy. Here is the scenario that we are working on.
1) ContainerGrid objectiveGrid = new ContainerGrid();
e.Row.RowIslands.Add(objectiveGrid);
we are using this mechanism to create the hierarchy of grids. number of child level grids is not fixed. I can grow to 5-10 levels (we have achieved this structure). Finally we have enabled the cell editing for last level of grid. & written update code in
protected
void onRowUpdating(object sender, Infragistics.Web.UI.GridControls.RowUpdatingEventArgs e) event. It works fine data gets updated into datbase. But this event fires the postback event & the child level grid(which is updated) retains it's old value.
How I can show the updated values in the child level grid? Attaching .aspx * .cs file for your reference.
Please let me know if you need more information on this? It is critical for us to fix this issues ASAP.
any updates on this issue.
nikhilach said: I have kept the RowAdding behaviour true for base WebHierarchicalGrid & EnableInheritance true as well. so it provides a row for adding data at bottom. In pager of the Products grid I have added html 'Add" button as CustomTemplate & on click of this I will add the row in database using ajax call (press Add button without loosing the focus from new row). Now after update I want to reload the grid in which I have added the new row (i.e Product Grid). How I can do that? also how I can prevent events that occurs when focus from new row is changed or enter key is pressed on last column? (this is secondary issue)
I have kept the RowAdding behaviour true for base WebHierarchicalGrid & EnableInheritance true as well. so it provides a row for adding data at bottom. In pager of the Products grid I have added html 'Add" button as CustomTemplate & on click of this I will add the row in database using ajax call (press Add button without loosing the focus from new row). Now after update I want to reload the grid in which I have added the new row (i.e Product Grid). How I can do that?
also how I can prevent events that occurs when focus from new row is changed or enter key is pressed on last column? (this is secondary issue)
I run your sample. So, I see that you make an AJAX call through onClientClick function when "Add button" is pressed and update your DB. According to the current configuration of the grid. The grid is not aware for this call / update, due to the fact that you are using custom API to accomplish this. One way to refresh the grid would be as you clear the rows collection and rebind it but in your case this will not work if you do this in the custom AJAX Call "AddRow()". Maybe you could take the approach when the new row is added and request complete to refresh the updatePanel and provide the new data for the grid. Another approach would be to use the built-in AJAX mechanism of the grid to update your DB. I mean not to use "Add Button" just only Add New row Behavior. Please note that if you use only " Add New row Behavior " the grid will use AJAX to submit the new data to the DB. Another thing that come up in my head now is that you could use RowEdit Template if you want to provide custom GUI for CRUD operations over the gird and keep its AJAX turn on.
So, about your question how to prevent the events in the grid? You are able to cancel them on the client as you subscribe to client - side event with "ing" suffixes.
Hope this helps.
Thanks Rado for your thougts,
Regarding Refreshing the grid I used some other approach which is 50% done. what I did is after my custom ajax call is completed which is used to add data in database I am collapsing the parent grid row. so now when I will expand parent row it will automatically fetch the latest record. below is the code for for collapsing the parent row (it is working as well).
//ajax method to update row in database
default_aspx.addRow(param);grid._parentRow._set_populated(false)grid._parentRow._set_expandedInternal(false);
now when I manually expand the parent row it fetch the latest reconrd. but I could not find the way which will automatically fire the expand event i tried keeping ._set_populated(true) & ._set_expandedInternal(true); but it did not work... is there any way i can expand the row at client side?
I tried RowEdit Template but it is not supported for container grid in Manual load on demand. if you have any link which has explained RoeEdit Template please let me know
If you want to expand a row on the client David has already responded here :
http://forums.infragistics.com/forums/p/36693/212649.aspx#212649
Hope this helps you.
Thanks Rado,
As I mentioned in my earlier thread I have already tried the option suggested by David & it gives me some javascript error. You can check this issue with the code sample that I have already provided in my previous thread.
Please replace onClientClick(gridId) in default.aspx as follows.
function onClientClick(gridId) { var grid = $find(gridId.id); var arry = new Array(); var param = ""; var key = ""; var value = ""; categoryID = grid._parentRow.get_dataKey()[0]; param = categoryID; //+ "&goalid=" + goalId; for (var i in grid.get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._row._cells) { arry[i] = grid.get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._row._cells[i].get_value(); key = grid.get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._row._cells[i]._column._key; value = grid.get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._row._cells[i].get_value(); //param = param + "&" + key + '=' + value; param = param + "&" + value; } default_aspx.addRow(param);
//collapse the parent row grid._parentRow._set_populated(false) grid._parentRow._set_expandedInternal(false); //This line is not working
grid._parentRow.set_expanded(1); }
HI Nikhil,
You are correct. There is a javascript issue. So, the good news is that I've tested your code with the latest service release for your version - 9.2.20092.2137 and it works as it should be. I would suggest keep the David's approach and go ahead and download the mentioned service release and upgrade.
Thanks
Hi Rado,
any updates on this?