Hi there,
I am trying to convert UltraWebGrid control to WebDataGrid control. I have a javascript handler UltraWebGrid1_BeforeCellChangeHandler(gridName, cellId) which is called for the CliendSideEvent BeforeCellChangeHandler. Could you please let me know what is the equivalent client event in WebDataGrid? I tried CellValueChanging in EditingClientEvents, but it did not work. Thanks for your help.
I am trying to convert UltraWebGrid control to WebDataGrid control.
I have a javascript handler UltraWebGrid1_BeforeCellChangeHandler(gridName, cellId) which is called for the CliendSideEvent BeforeCellChangeHandler.
Could you please let me know what is the equivalent client event in WebDataGrid? I tried CellValueChanging in EditingClientEvents, but it did not work.
Thanks for your help.
Hi
If i want to copy and paste and would like to change the cell format for all the cells which have been changed how can i achieve this i am trying to use <ClipboardClientEvents Pasted="WebDataGrid_Clipboard_Pasted" /> but unable to get all the cells which have been modified
Regards
Raghu
Hi Hristo,
The code works perfectly.
Thank you very much for your quick response. I really appreciate your help in this regard.
Hello dganesh,
You can enable activation and handle ActiveCellChanging event to make cells editable only if they are from the second column.
try it something like this:
<head runat="server"> <title></title> <script type="text/javascript" id="igClientScript"> <!-- function WebDataGrid1_Activation_ActiveCellChanging(sender, eventArgs) { ///<summary> /// ///</summary> ///<param name="sender" type="Infragistics.Web.UI.WebDataGrid"></param> ///<param name="eventArgs" type="Infragistics.Web.UI.ActiveCellChangingEventArgs"></param> //Add code to handle your event here. //Check if the new active cell is from the first column if (eventArgs.getNewActiveCell().get_column().get_index() == 0) { //Cancel event eventArgs.set_cancel(true); var index = eventArgs.getNewActiveCell().get_row().get_index(); var cell = sender.get_rows().get_row(index).get_cell(1); //make thecell from second column active sender.get_behaviors().get_activation().set_activeCell(cell); } }// --> </script> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" Text="Button" /> <ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"> <Columns> <ig:BoundDataField DataFieldName="ProductID" Key="ProductID"> <Header Text="ProductID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="ProductName" Key="ProductName"> <Header Text="ProductName" /> </ig:BoundDataField> </Columns> <Behaviors > <ig:EditingCore> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="ProductID" ReadOnly="True" /> </ColumnSettings> <EditModeActions EnableOnActive="True" EnableOnKeyPress="False" MouseClick="Single" EnableF2=false /> </ig:CellEditing> </Behaviors> </ig:EditingCore> <ig:Activation > <ActivationClientEvents ActiveCellChanging="WebDataGrid1_Activation_ActiveCellChanging" /> </ig:Activation> </Behaviors> </ig:WebDataGrid> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [ProductID], [ProductName] FROM [Alphabetical list of products]"> </asp:SqlDataSource> <ig:WebScriptManager ID="WebScriptManager1" runat="server"> </ig:WebScriptManager> </div> </form> </body>
Please let me know if this is works for you
Thanks for your quick response.
I was trying to get the client event for overriding the tab key press in the grid.
I have another question. In the WebDataGrid, I am trying to use tab key to move from one row to the next.
In my grid, I have 2 columns and only one column (column2) is editable. When I press tab I should go the next row (column2). How will I be able to do it ?
I have set EnableOnActive in EditModeActions to true, EnableF2 to false. The tab key press takes me to the column1 of the next row which is readonly. I want it to go the editable column (that is column2) and not the readonly column.
Thanks a lot for your help.
Hi dganesh,
maybe you could use EnteringEditMode
http://help.infragistics.com/NetAdvantage/aspnet/Current/CLR4.0?page=Infragistics4.Web.v11.1~Infragistics.Web.UI.GridControls.EditableClientEvents_members.html
Hope this helps