Hi, I am new to .NET and Infragistics;
I would like to perform certain actions in server side,after I add rows to webdatagrid
Currently I am using onRowAdded event in the webdatagrid
OnRowAdded="webdatagrid1_RowAdded"
in the server side
After the rows have been added to webdatagrid using webdatagrid1.get_rows().add(rows) in client side (javascript)
The following code to hide 2 columns should be hit in server side
Protected Sub webdatagrid1_RowAdded(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.RowAddedEventArgs) Handles webdatagrid1.RowAdded With sender .Columns(.Columns.Count - 3).Hidden = True .Columns(.Columns.Count - 2).Hidden = True End WithEnd Sub
However this doesn't get hit.
What do I need to do to perform hiding two specific columns in server side after I add rows to webdatagrid
Your help is much appreciated.
Hello Niranjani,
Thank you for contacting Infragistics Developer Support!
I am not able to determinethe source of the issue by the given information. Please review and modify the attached sample so the issue reproduces and attach it to your reply.
Thanks Denis,
this worked.
I would like to know how do I code using AJAX to avoid entire page to re-load when server hit of the onRowAdded method takes place
Protected Sub WebDataGridOnRowAdded(sender As Object, e As RowAddedEventArgs) 'TO DO handle event End Sub
Regards
Niranjani
Hello Niranjani,You can set enable EnableAjax property of the grid to true.
1 <ig:WebDataGrid ID="WebDataGrid" runat="server" Height="350px" Width="450px" 2 AutoGenerateColumns="False" DataSourceID="SqlDataSource" 3 OnRowAdded="WebDataGridOnRowAdded" 4 EnableAjax="true"> 5 ... 6 </ig:WebDataGrid>
Thnaks Denis that worked, But that doesn't meet me expectation.
I have a webdatagrid , on click of a button I add multiple rows from a asp datagrid to webdatagrid in client side.
To do this I have enabled BatchUpdating.
The newly added multiple rows are not saved to the database untill I submit .
After adding multiple rows to webdatagrid I perform some actions in OnRowAdded event in server side.
At this point page refesh takes place which I am trying to avoid by enabling Ajax so that only the webdatagrid reloads and entire page resfesh can be prohibited.
The problem I face is that , since the newly added multiple rows are not saved to database, when I set EnableAjax to true the webdatagrid loads with the data which are already available in the database and the newly added rows disappear.
Please let me know how do i handle this issue.
Thanks in advance
Please provide isolated sample project replicating your issue, attached to your reply.