This is a migrated thread and some comments may be shown as answers.

RadGrid & when EditMode is on Batch issue/bug

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
djbox3
Top achievements
Rank 1
djbox3 asked on 24 Sep 2014, 03:36 PM
Currently I'm facing a RadGrid issue/bug where I'm unable to bring up the correct Edit input row.
Only happen if holding down your mouse while you click on a cell and drag away the mouse elsewhere and let go of the mouse click.

I have created an example scenario. The code is down below.
The first column is a GridTemplateColumn which contains a RadComboBox.
The second column is a GridBoundColumn. 

RadGrid Settings:
            <ClientSettings>
                <Selecting AllowRowSelect="False" CellSelectionMode="SingleCell" />
                <ClientEvents OnCellSelected="onCellSelected" />
            </ClientSettings>
            <MasterTableView EditMode="Batch">
            <BatchEditingSettings EditType="Cell" />

Here is a scenario to reproduce the symptoms that I'm facing.
* Click on a GridTemplateColumn column cell which brings up the correct EditItemTemplate row and user can enter their input, etc.
* Click on a different GridTemplateColumn column cell and hold down your mouse while you click and drag away the mouse elsewhere and let go of the mouse click.
* Radgrid will highlight the correct GridTemplateColumn column cell however the previous EditItemTemplate row is still displays in edit mode.
* Repeat same step on to a different column.

~Any help would be greatly appreciated.

Markup
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <script>
 
        function onCellSelected(sender, a_args)
        {
            var v_gridItem = a_args.get_gridDataItem();
            console.log(v_gridItem._element.sectionRowIndex);
            var selectedColumn = a_args.get_column();
            var dataItem = a_args.get_gridDataItem();
            var output = String.format("The selected cell is located in column with name: " + selectedColumn.get_uniqueName() + " and in row with index: " + dataItem.get_itemIndexHierarchical() + ".");
            console.log(output);
        }
    </script>
    <div>
        <telerik:RadGrid runat="server" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" >
            <ClientSettings>
                <Selecting AllowRowSelect="False" EnableDragToSelectRows="false" CellSelectionMode="SingleCell" />
                <ClientEvents OnCellSelected="onCellSelected"/>
            </ClientSettings>
            <MasterTableView EditMode="Batch" AutoGenerateColumns="False">
                <BatchEditingSettings EditType="Cell" />
                <Columns>
                    <telerik:GridTemplateColumn UniqueName="Data" ItemStyle-BackColor="" FilterControlWidth="100px" ItemStyle-Width="100px" Resizable="false" HeaderStyle-Width="110px"
                        DataField="Col2" HeaderText="Col0" FilterImageUrl="~/images/funnel-icon.png">
                        <ItemTemplate>
                            <%# Eval("Col2")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBoxData" runat="server" EnableViewState="false" IsCaseSensitive="False" DropDownAutoWidth="Enabled" Height="125" Width="113%"
                                DropDownWidth="250" NoWrap="true" OnClientKeyPressing="" EnableItemCaching="true" />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                     <telerik:GridBoundColumn DataField="Col1" UniqueName="Col1" HeaderText="Col1" HeaderStyle-Width="60px" Resizable="false" AllowFiltering="false"
                        ReadOnly="False" Display="true" Visible="true" ItemStyle-ForeColor="Blue" HeaderStyle-HorizontalAlign="Center" />
      
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
using System;
using System.Data;
using Telerik.Web.UI;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Col1");
        dt.Columns.Add("Col2");
 
        for (int i = 0; i < 20; i++)
        {
            dt.Rows.Add(new object[] {i, string.Format("desc_{0}", i)});
        }
        RadGrid1.DataSource = dt;
    }
}




1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 29 Sep 2014, 12:23 PM
Hello,

You can try to change the OpenEditingEvent to MouseDown and let me know if it works in your specific scenario.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
djbox3
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or