Hi Team,
I wanted to know the use of "OnItemCommand" event. When exactly do we have to use this particular event?
And how to form the command Argument for this event? An example would be great.
I have a 3 level nested grid view(infragisitcs webdatagrid) where there is a row in the final child grid, where I want to do some manipulation and data has to be reflected accordingly on the UI.
For this to work correctly, which event I will have to use? Currently I am using "OnInitializeRow" which is not displaying the updated data on the UI(Data is being binded in the backend code properly but not displaying it on the screen). So, I wanted to know which event to be used if we have to do any data manipulations on the row and the data should reflect on the screen immediately after the manipulation.
Ex: I have a label with Status as "Review In Progress" and a button as "Review". Clicking on button "Review" will open a modal pop up and there I have another button to approve the item. After approving the item, the modal pop up will be closed by using a close button. After this, I actually have to see the status changed to "Approved" on the UI which is not happening. Instead of displaying "Approved" status it still has the old status "Review In Progress". I will have to collapse the child grid and have to open again to see the updated data. So, I feel I am not using the right event for this scenario.
Kindly help me with this issue how can I get it resolved. Thanks.
Hello Madhuri,
Information on how to use the ItemCommand event and form its argument may be found at:
http://www.infragistics.com/community/forums/p/32581/181794.aspx#181794
Regarding formatting the values of a child grid's rows - the InitializeRow event is the stage where such changes would usually be applied. If that is not working in this case, please ensure that the postback (if it is not the grid itself) causing this formatting also updates the grid. You may try forcing this using the grid's RequestFullAsyncRender() method if AJAX is used.
The second issue with updating the child grid's Approved state may be related to the timing of the change. However, in order to be able to investigate this further and provide you with more specific feedback, I would need a working sample demonstrating both behaviors.
Please do not hesitate to contact me with any updates or questions.
Thank you for your reply.
I have tried the following:
webGrdItem.RequestFullAsyncRender();webGrdItem.Rows.Clear();, webGrdItem.Columns.Clear();webGrdItem.AutoGenerateColumns = true;webGrdItem.ClearDataSource();
but none of these are working.
Can you please tell me which event to be used in the below scenario:
child grid has some data. Clicking on a button in this child grid opens a modal pop up where I will do the change and closes the modal pop up. Now, the data should be reflected as soon as I close this modal pop up .
Can you please tell me how can I achieve this?
Thanks.
In order to initiate a refresh of the WHDG after the closing of the popup, a callback should be initiated. I would suggest handling the closed event of the dialog and initiating a postback (for instance using __doPostBack()) in order to try and force the grid to refresh.
Regarding the posted code, please note that if the child band has autogenerated columns it should not be necessary to clear the Columns collection. Clearing the Rows collection should also not be necessary.
Please feel free to contact me if you need more information.
Thanks Petar,
But I already am using the mentioned like below
"<asp:LinkButton ID="lnkApprovalCancel" runat="server" OnClientClick="__doPostBack(id,'');" OnClick="approval_click" class="xlButton">Close</asp:LinkButton>"
Modal pop up code:
<ajx:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="btnPopupApprovalInvoker" PopupControlID="pnlApproval" CancelControlID="lnkApprovalCancel" BackgroundCssClass="inactive" BehaviorID="approvalModalPopup"> </ajx:ModalPopupExtender> <asp:Panel runat="server" ID="pnlApproval" CssClass="modalPopupLg" Width="500" Height="350" Style="display: none"> <table width="485px" align="center" border="0" style="height: 335px"> <tr> <td> <div id="divApprovalItemTarget" style="font-family: Arial; font-size: 24px; color: #333333; font-weight: bold"> </div> </td> </tr> <tr> <td align="center"> <table border="0" width="75%" style="background-color: #E5E5E5; border-top: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000"> <tr> <td> <!-- form here --> <uc2:ApprovalWindow ID="ApprovalWindow1" runat="server" /> <!-- end form --> </td> </tr> </table> </td> </tr> <tr> <td align="right" valign="bottom">
<asp:LinkButton ID="lnkApprovalCancel" runat="server" OnClientClick="__doPostBack(id,'');" OnClick="approval_click" class="xlButton">Close</asp:LinkButton> </td> </tr> </table> </asp:Panel>
Regards,
Madhuri
I am attaching a sample illustrating how a WHDGs child band may be updated on a button click. Please note that in order to investigate the issue in your particular scenario, I would need a working sample demonstrating the behavior with the used modal popup implementation.
Feel free to contact me with any updates or questions.
Thank you Petar,
But we are not using WebHierarchichalDataGrid(WHDG), we are only using WebDataGrid(WDG) as I mentioned in the post. what is the difference between the two?
Which one do I have to use If I have a 3 level nested gridview? Using WDG will suffice?
The WebHierarchicalDataGrid control allows displaying multi-level parent-child relationships in grid form. In that sense it is different from the WebDataGrid which can display only flat data.
http://help.infragistics.com/doc/ASPNET/2014.2/CLR4.0/?page=Web_WebHierarchicalDataGrid.html
In order to be able to provide you with more specific information regarding your scenario, I would need a working sample demonstrating the issue and the precise manner in which the flat WebDataGrids are being nested.
Please feel free to contact me with any updates.
Please find the attachment of the sample code(not a working sample) which may help you to understand and analyze the problem along with screen shots.
Please let me know if we are using it in right way. Or we will have to switch to WebhierarchichalDataGrid for this issue to resolve? Please advice.
Thank you for the attachment.
Looking at your implementation, it appears that a lot of customizations have been made in this case in order to display a hierarchical structure. If I am understanding the page structure correctly, in this case a different datasource (unrelated to the parent row possibly) is to be displayed for each child layout. Therefore you may be interested in the WHDG in this case and its Manual Load On Demand feature:
http://help.infragistics.com/doc/ASPNET/2014.2/CLR4.0/?page=WebHierarchicalDataGrid_Load_On_Demand.html
Regarding the other updating issues, as I have mentioned earlier, I will need a runnable sample clearly demonstrating the behavior in order to be able to provide you with any additional feedback.
Please feel free to contact me if you have any questions.