Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
WebDataGrid Add new Row apart from using Enter and Tab keys
posted

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>