We are using Net Advantage 2011.2. We have a button click event where we pull webhierarchical grid data into it to save it based on functionality. However we are not getting webhierarchical grid data as expected. We are binding data from codebehind.
protected Sub btn_clickEvent(ByVal Sender as Object, ByVal e as EventArgs) handles btn.ClickEvent
Dim testGrid as Infragistics.Web.UI.GridControls.WebHeirarchicalGrid
testgrid = Me.GridFromUI
End Sub
In the above example we are not getting GridFromUI grid values. Please provide us a way to use data from Grid on a button click event
Hello Avinash,
Thank you for contacting us.
The code seems correct. Are you sure you perform data bind on page load? Can you send me a working sample of your webdatagrid so I could further investigate?
Also, please note that the version you are using is retired several years ago and it is currently not supported. The product lifecycle is stated in the following page:www.infragistics.com/help/product-lifecycle.
Please let me know if I could be of further assistance.
Hi Tihomir iliev,
Thanks for your response,
I performed data bind on page load. I am adding a sample code in C#. Kindly go through it. In the attached code we are getting row count (Don't know whether its correct or not) but for column count we are getting 0. We want to get those column and their respective values.
Hi Tihomir Iliev,
Thank you its working as expected. But we are unable to get child rows of band(0). For parent rows we used Grid.Rows but we need to get rows of child band or any way to enumerate through child rows .
Please guide us in it
Hello Katti,
Here is a sample of how you could enumerate through child rows:
I am also attaching a sample.
Please have in mind that you have access to the records which are already data bound. I set InitialDataBindDepth="1"so I could have access to all child records. If you haven't loaded any of your child records and you still want to enumerate all of them, please query the DataSource directly because otherwise you might experience performance issues.
Let me know if you need further assistance.
All the solutions you provided are working successfully. Thank you. However we are not getting updated child band values on button click event (getting old values not updated values). Could you please look into this issue and kindly let me know if you need more information on this issue.
If you want to get access to the new values, you should trigger Row_Updating event from the client side. This can happen by executing this on your button click event:
After that you would have the old and the new values on the server:
I am attaching a working sample based on your sample.
Also, I am reminding again that the version you are using is retired several years ago and it is currently not supported. The product lifecycle is stated in the following page:www.infragistics.com/help/product-lifecycle.
Hi,
That sample was build using V11.2, However we are using v15.2 for now. I tried adding perform function to button click
<asp:button id="save" runat="server" on click="test" onClientClick="performUpdate">
<script>
function performUpdate(sender, event) { ig_controls.MainContent_g1.get_gridView().get_behaviors().get_editingCore().commit() event.preventDefault();}
</script>
In real time we are using VB.net and perform update function on client click is not working.
From my understanding on rowUpdating method we will get new values and we have to change values in dataset manually.Once row updating is complete it will move to button click event. Please guide me if my understanding it is not correct.
Hi Avinash Katti,
Thank you for your update.
It still works on my side. Could you send me a working sample demonstrating this behavior?
I am looking forward to your sample.
I have passed event into function. I didn't changed any code which was attached earlier. I am adding screenshot of the issue and code. Please go through it. Input string error issue is occuring in the same sample.
For the sample attached how can we configure it to update the dataset. Do we have to do it manually or configuring it on some process (Please note that parent band is updating as expected, only child band is not updating).
1. You do not need jQuery to call event.preventDefault(). Please take a look here - http://www.w3schools.com/jsref/event_preventdefault.asp. As I mentioned, your issue is that you do not pass the event object to the function.
2. WebDataGrid attempts to automatically persist changes using the mechanism of the underlying data source. This means that if the data source control does not support CRUD operations, you must handle these operations manually to provide such functionality. Check this link for information regarding different data sources - http://help.infragistics.com/Help/Doc/ASPNET/2011.2/CLR4.0/html/WebDataGrid_Supported_Data_Sources.html.
3. Please provide a sample demonstrating this behavior.
Please let me know if you need anything else.
Iam having the same issue. So i downloaded above attached files and started debugging it. i observed that iam receiving an error at event.preventDefault(). From my understandoing event.PreventDefault() is related to Jquery and i didnt find any jquery library in above attached solution. So please help me with below qeustions.
1. Do we have to add jquery to make solution working or is it available internally.
2. Do we have to update datasource manually in RowUpating event so that we can pull it whenever we want or is it automatically updating data source.(Auto-crud is in default state)
3. I am hitting Input string error after executing performUpdate function and observed that code is correct. is it occuring due to any mis representaion of infragistics controls or data source
Please let me know if you need more information
Hello,
In one of my previous posts I have attached a working solution based on your solution. Did you check it? You have not passed the event object to the function. I am attaching a screenshot of what you are missing.
Please let me know if you need further assistance.