Hi,
i am adding a new row at the top of the WHDG for adding new record into the database
like this
http://samples.infragistics.com/aspnet/Samples/WebHierarchicalDataGrid/EditAndSelection/AddNewRowOnParentLevel/Default.aspx?cn=hierarchical-data-grid&sid=a8ae7106-63a5-49d0-bfe8-fc1225a54b21
There is a save Button outside the WHDG and when i click on the save button the data inside the newly added data grid row must be added to the database
But when i click on the save button the rowAdding Event is not getting fired
protected
void WebHierarchicalDataGrid1_RowAdding(object sender, Infragistics.Web.UI.GridControls.RowAddingEventArgs e)
this event is not getting fired ..
what is the issue with this ..... please help me please.........................
Hi infra100,
Thank you for posting in the community.
The RowAdding, RowUpdating and RowDeleting events are fired when the AutoCRUD property of the Editing core is set to false,i.e. when you are manually handling the read-update-delete of your datasource. Therefore, in your case setting the AutoCRUD to false would allow you to handle these events.
You may want to consider using AutoCRUD (given that the type of datasource you are using supports that feature). A useful video illustrating how AutoCRUD may be setup is available here:
http://blogs.infragistics.com/aspnet/media/p/218616.aspx
A similar resource for setting Manual CRUD can be found at:
http://blogs.infragistics.com/aspnet/media/p/218617.aspx
Please tell me if this helps.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://www.infragistics.com/support
Please feel free to contact me if you still need assistance regarding this matter.
hi peter ,
please see the above image u will understand my problem in a better way
the button is outside the grid and when i click the button the rowadding event of WHDF is not firing
when the cursor is inside the postol code column and i hit enter key then it is working fine
i want it to work when i hit the button which is outside the grid
why it is not working please reply,
Thank you for your reply.
I am attaching a sample which demonstrates the functionality you are looking for. The row adding is triggered by default from the add new row functionality of the grid and if a postback occurs when the data is only entered in the newRow fields, the row is not added.
You can use an html <input> to fulfil your requirement. By handling the onclick client-side event, you can add a row programmatically from the grid with the data from the new row fields. This will automatically cause a postback and fire the server side events. Note that an input field should be used and not an asp:Button (as the client-side row adding causes a postback and it is not possible to cleanly cancel the button's postback).
Here is the relevant javascript I have used:
function addRowAndPostback() { var grid = ig_controls.WebHierarchicalDataGrid1.get_gridView(); var newRow = ig_controls.WebHierarchicalDataGrid1.get_gridView().get_behaviors().get_editingCore().get_behaviors().get_rowAdding().get_row(); var valueArray = new Array(); for (i = 0; i < newRow.get_cellCount(); i++) { valueArray[i] = newRow.get_cell(i).get_value(); } grid.get_rows().add(valueArray); }
for (i = 0; i < newRow.get_cellCount(); i++) { valueArray[i] = newRow.get_cell(i).get_value(); } grid.get_rows().add(valueArray); }
Please let me know if this helps.
Please feel free to contact me if you need further assistance with this scenario.