Hi,
I have used webdatagrid 13.1 version and locally installed the infragistics. And i have written a aspx page with the below code to enable the cell editing option by clicking mouse with single or double. Its working find for me. But the same code has been deployed where cell clicking is not possible in the grid as part of edit\Update the record.
asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<igtbl:webdatagrid id="dgSilhoutte" runat="server" datakeyfields="KeyfieldID" autogeneratecolumns="false"
width="976px" headercaptioncssclass="dgMaintainSillcode-hc" onrowsdeleting="dgSilhoutte_RowDeleting"
itemcssclass="dgMaintainSillcode-ic" enabledataviewstate="true">
<Behaviors>
<igtbl:Selection Enabled="true" CellClickAction="Cell">
<AutoPostBackFlags CellSelectionChanged="true" />
<SelectionClientEvents CellSelectionChanged="fileGrid_CellSelectionChanged" />
</igtbl:Selection>
<igtbl:Activation Enabled="true"></igtbl:Activation>
<igtbl:EditingCore Enabled="true" AutoCRUD="False" BatchUpdating="True">
<EditingClientEvents/>
<igtbl:CellEditing Enabled="True">
<ColumnSettings>
<igtbl:EditingColumnSetting ColumnKey="SILHOUETTEID" ReadOnly="true" />
</ColumnSettings>
<EditModeActions MouseClick="Single" />
<CellEditingClientEvents />
</igtbl:CellEditing>
<igtbl:RowDeleting Enabled="true" ></igtbl:RowDeleting>
</Behaviors>
</igtbl:EditingCore>
<Columns>
<igtbl:BoundDataField DataFieldName=" KeyfieldID " Key=" KeyfieldID " width="3%" Header-Text=" fieldID1 " CssClass="columnCSS" >
</igtbl:BoundDataField>
<igtbl:BoundDataField DataFieldName=" fieldID2" Key=" fieldID2" width="5%" Header-Text=" fieldID2" CssClass="columnCSS" >
<igtbl:BoundDataField DataFieldName=" fieldID3 " Key=" fieldID3" width="8%" Header-Text=" fieldID3" CssClass="columnCSS" >
<igtbl:BoundDataField DataFieldName=" fieldID4" Key=" fieldID4" Header-Text=" fieldID4" width="4%" CssClass="columnCSS" >
<igtbl:BoundDataField DataFieldName=" fieldID5" Key=" fieldID5" Header-Text=" fieldID5" width="5%" CssClass="columnCSS">
<igtbl:BoundDataField DataFieldName=" fieldID5" Key=" fieldID5" width="5%" Header-Text=" fieldID5" CssClass="columnCSS">
<igtbl:TemplateDataField Key="TemplateColumn1" width="3%" CssClass="columnCSS">
<ItemTemplate>
<asp:LinkButton ID="deleteLink" runat="server" OnClick="deleteLink_Click" CausesValidation="false"> <asp:Image ID="imgdelete" runat="server"
ImageUrl="~/Images/Trash.gif" />
</asp:LinkButton>
</ItemTemplate>
<Header Text="Delete" />
</igtbl:TemplateDataField>
</Columns>
</igtbl:webdatagrid>
======================================================/
function fileGrid_CellSelectionChanged(sender, e) {
var newSelectedCell = e.getSelectedCells().getItem(0);
var colSelected = newSelectedCell._column._key
if (colSelected == "TemplateColumn1") {
var grid = $find("dgSilhoutte");
var editingCore = grid.get_behaviors().get_editingCore();
var userConfirmation = window.confirm("Are you sure want to Delete this Record?");
if (userConfirmation == true) {
grid.get_rows().remove(grid.get_rows().get_row(newSelectedCell._row._index));
editingCore.commit();
}
else
e.dispose();
Hi Malathi Dhandapani,
Thank you for posting on our forums.
Can you provide me with more details on the behavior you are getting when you click on a cell? Does it perform a postback? Does your client-side Selection function fire?
There are a few things that I don't understand in code you've provided: 1. You've set the AutoPostbackFlags property to true even though you are calling the commit() method in your client-side Selection function. Calling this function essentially performs a postback. 2. If userConfirmation returns false, you call a dispose() method. Is there are reason for this? What are you trying to achieve by disposing the CellSelectionChangedEventArgs object? If you're trying to cancel the selection, I recommend using the CellSelectionChanging client-side event and using the set_cancel() method. 3. You have EnableDataViewState set to true while using the EditorCore behavior of the WebDataGrid. Note, EnableDataViewState isn't required for the WebDataGrid and tends to increase overhead in this case. I recommend setting this to false and rebinding the WebDataGrid on each postback (using Session or other server-side storage solution).
I am looking forward to your update on this.
Hi ,
Thanks for your response!
I have disabled the option EnableDataViewState to False. But i am not sure 'AutoPostbackFlags' since i have used dataset, manually i am saving the data in database on button click event. and i dont see the funcion calling will do post back.
My convern here is the above code is working fine in my local where i have installed all the necessary infragistics software. but when i deployed on server, cell clicking is not easy to update on the cell. This is the case in IE9 where in IE11 i am able to do update on single\double where ever applicable
Note:- In server infragistics has not been installed. only the Infragistics dll of version 13.1 has been placed under bin folder of the project.
Thanks,
Malathi
Hi Malathi,
Thank you for the update.
Can you provide me with the details I've requested in my last update:Can you provide me with more details on the behavior you are getting when you click on a cell? Does it perform a postback? Does your client-side Selection function fire?Also, I haven't been able to reproduce this behavior and it appears to be environment specific. Do you know if the browser is configured to render your web application under compatibility view? Is this issue reproducible in other environments with IE9 installed?
Lastly, if possible, please provide us with a sample which we can use to reproduce this issue and the build number for the Infragistics assemblies you're referencing.
We are looking forward to your update.
Please let me know if you were able to resolve the issue with CellEditing for the WebDataGrid, or if you still require further assistance.
I am looking forward to your update.