Hi,
Cell editing is allow in my grid. what i want,
i always want to show numric control in a cell to edit the cell data.
currently it show only when row is active or user click on perticular cell.
how can i always show the cell in editing mode?
i don't want to use template column for this scenario. is there a way to show the cell
in editing mode?
or if possible then if user select the row then i want to show the cell
in edit mode?
Hi Mypost,
Thank you for posting in the community.
It is not possible to display an editor in each cell of a column when using an editor provider as the provider is in fact a single control which is displayed in the cell only when it is in edit mode. However, you can configure a row cell to enter edit mode by handling the RowSelectionChanged clientside event. For instance:
function WebDataGrid1_Selection_RowSelectionChanged(sender, eventArgs){ ///<summary> /// ///</summary> ///<param name="sender" type="Infragistics.Web.UI.WebDataGrid"></param> ///<param name="eventArgs" type="Infragistics.Web.UI.RowSelectionChangedEventArgs"></param> var cellWithProvider = eventArgs.getSelectedRows().getItem(0).get_cell(0); sender.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().enterEditMode(cellWithProvider); }// -->
function WebDataGrid1_Selection_RowSelectionChanged(sender, eventArgs){ ///<summary> /// ///</summary> ///<param name="sender" type="Infragistics.Web.UI.WebDataGrid"></param> ///<param name="eventArgs" type="Infragistics.Web.UI.RowSelectionChangedEventArgs"></param> var cellWithProvider = eventArgs.getSelectedRows().getItem(0).get_cell(0); sender.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().enterEditMode(cellWithProvider);
}// -->
Feel free to contact me if you have any questions.
Thanks for reply.
it work but when i select the row then cell comes in editing mode for a second. and then it goes out.
what should i do to stay the cell in editing mode?
Thanks
Thank you for your reply.
Under IE7/8/9 Firefox and Chrome the desired cell seems to be staying in edit mode when using version 11.2.20112.1019. Please let me know what version of .NetAdvantage you are using so that I may research whether some specifics apply in your case. Also note that using some behavior combinations may prevent the cell from staying in edit mode in this scenario, therefore it would be helpful to see your grid markup.
Please feel free to contact me if you have any additional questions.
Thanks for reply,
i am doing test in IE8 and IE9 browser.
i am using infragistic 11.2 version.
Look below html:
<ig:WebDataGrid ID="webTableGrid" runat="server" EnableViewState="true" EnableAjaxViewState="true" AutoGenerateColumns="False" OnColumnResized="webTableGrid_ColumnResized" Width="100%" OnPageIndexChanged="OnPageIndexChanged" DefaultColumnWidth="100%" DataKeyFields="Id" OnInitializeRow="OnInitGridRow" OnRowUpdating="Row_Updating" ClientEvents-DoubleClick="OnRowDoubleClick"> <Columns> <ig:BoundDataField DataFieldName="Name" Key="Name" Header-Text="Name" Width="80" /> <ig:BoundDataField DataFieldName="Count" Key="Count" Header-Text="" Header-CssClass="HeaderClass" DataType="System.Int32" Width="20" /> <ig:BoundDataField DataFieldName="Comment" Key="Comment" Header-Text="Notes" /> <ig:BoundDataField DataFieldName="Id" Key="Id" Hidden="true" Width="0" /> </Columns> <EditorProviders> <ig:NumericEditorProvider ID="CountProviderVal" EditorControl-Buttons-SpinButtonsDisplay="OnRight" EditorControl-MinValue="0" EditorControl-MaxValue="30000" /> </EditorProviders> <Behaviors> <ig:EditingCore> <Behaviors> <ig:CellEditing EditModeActions-MouseClick="Single"> <CellEditingClientEvents EnteringEditMode="jwGridCellEditingEnteringEditMode" /> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Count" EditorID="CountProviderVal" ReadOnly="false" /> <ig:EditingColumnSetting ColumnKey="Name" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="Comment" ReadOnly="true" /> </ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> <ig:ColumnResizing Enabled="true"> <AutoPostBackFlags ColumnResized="true" /> <ColumnSettings> <ig:ColumnResizeSetting ColumnKey="Comment" EnableResize="false" /> </ColumnSettings> </ig:ColumnResizing> <ig:Selection CellClickAction="Row" RowSelectType="Single" EnableCrossPageSelection="true"> <SelectionClientEvents RowSelectionChanged="OnRowSelectionChanged" /> </ig:Selection> <ig:Activation Enabled="true" /> <ig:Paging PagerMode="NextPreviousFirstLast" PagerAppearance="Both" /> <ig:Sorting Enabled="false" /> <ig:ColumnMoving Enabled="false" /> </Behaviors> </ig:WebDataGrid>
Thank you for the sample code.
The desired cell is not remaining in edit mode upon a change in row selection as the MouseClick edit mode action of the updating behavior is set to single, i.e cells enter edit mode on a single mouse click. I would suggest that you consider setting this property to Double which should resolve the matter.
Alternatively, you may try handling the ExitingEditMode clientside event of the updating behavior and cancelling the event if the row has just been changed (when the cell in question should remain in edit mode). For instance:
Hope this helps.
Above code work great. but when i edit cell value and then select another row then new selected row
does not come in editing mode, because after editing cell value, cell value changed event fire. Is there a way to resolve this issue?
Please feel free to contact me if you have any questions regarding this matter.
Apologies for the delayed response.
After a cell has been edited an AJAX call is made in order to update the grid's datasource. I can suggest enabling BatchUpdating in the editing core in order to not update the grid on each cell change.