Hello,
Doing a POC using https://www.infragistics.com/samples/aspnet/data-grid/add-new-row-server-events
I see that the row add event (RowAdding) is firing apart from using enter or tab keys (like click on another row and the add row event is fired after typing in the values in the new row) from the above link. The same functionality i did in my poc but the add row event is not firing after i click on another existing row.
However tab and enter keys are working for the RowAdding event.
How is that possible?
Vb.NET Code Behind:
grdDataTable.Behaviors.EditingCore.Enabled = True grdDataTable.Behaviors.EditingCore.EnableInheritance = True
With grdDataTable.Behaviors Dim gridBehavaior As GridBehavior = .EditingCore.Behaviors.CreateBehavior(Of RowAdding)() .EditingCore.Behaviors.Add(gridBehavaior) .EditingCore.Behaviors.RowAdding.Enabled = True .EditingCore.Behaviors.RowAdding.EnableInheritance = True .EditingCore.Behaviors.RowAdding.Alignment = AddNewRowAlignment.Bottom .EditingCore.Behaviors.RowAdding.EditModeActions.EnableOnActive = True .EditingCore.Behaviors.RowAdding.EditModeActions.MouseClick = EditMouseClickAction.Single
.aspx:
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel runat="server" ID="SampleUpdatePanel" ChildrenAsTriggers="true" UpdateMode="Conditional"> <ContentTemplate> <ig:WebExcelExporter ID="eExporter" runat="server"></ig:WebExcelExporter> <ig:WebDataGrid ID="grdDataTable" runat="server" AutoGenerateColumns="true" width="100%" ViewStateMode ="Enabled" EnableViewState ="true" EnableDataViewState="True" HeaderCaptionCssClass="WebDataGridColumnHeader" ItemCssClass = "WebDataGridRow" AltItemCssClass = "WebDataGridAlternating" OnColumnSorted="grdDataTable_SortColumn" OnPageIndexChanged="grdDataTable_PageIndexChanged" OnInitializeRow="grdDataTable_InitializeRow" OnRowAdding="grdDataTable_RowAdding" OnRowAdded="grdDataTable_RowAdded"> <Behaviors> <ig:Selection CellClickAction="Row" CellSelectType="Single" RowSelectType="Single" SelectedRowSelectorCssClass="DataGridSelectedRow" > </ig:Selection> <ig:Paging PagerAppearance="Bottom" PageSize="100" Enabled="true" /> <ig:Sorting SortingMode="Single" Enabled="true" /> <ig:ColumnResizing Enabled="false" /> <ig:Activation> </ig:Activation> <ig:EditingCore Enabled="false"> <Behaviors> <%--<ig:cellediting> <editmodeactions mouseclick="single" /> </ig:cellediting> --%> </Behaviors> </ig:EditingCore> </Behaviors> </ig:WebDataGrid> </ContentTemplate> </asp:UpdatePanel>
Hello Aravind,Thank you for the code-snippet and the sample reference you have provided.It seems that the question you are having is the same as the one on the following thread, to which I have already replied.For detailed information on this matter, you can take a look at the referenced thread.If you have any questions, please let me know.
Hi Tacho,
To add , when I tested the code you attached to the thread I don't see the new add row. See screenshot below. I tried to place it in both top and bottom & I don't see it.
Thanks,
Aravind
Hello Aravind,Thank you for the code-snippet and the screenshot you have provided.I have attached a sample application that uses both an UpdatePanel and a manual CRUD operation for adding the new row to the underlying DataTable by handling the RowAdding event. (An asp:Label gets updated when the event is fired.)The reason the add new row was missing from the screenshot you referred to is because the styles for the WebDataGrid are not present. I have included and referenced them in the current sample, which will automatically style the WebDataGrid.If you have any questions, please let me know.
WebDataGrid_sample(Modified)