Jun 23, 2011, 7:36 AM
Editable grid with Combobox
I am having one editable grid. its having two columns, Column one edit type is combo box and another is text box.
After editing column 1 i click column 2 for editing, here focus is coming to column 2 and suddenly the focus is went out.
how to fix this?
Sample code
After editing column 1 i click column 2 for editing, here focus is coming to column 2 and suddenly the focus is went out.
how to fix this?
Sample code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestApp2010.Test.WebForm1" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<div>
<ext:GridPanel ID="GridPanel1" runat="server" Width="300" Height="200" Title="EditableGrid Plugin">
<Store>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Value" Type="Int" />
<ext:RecordField Name="Text" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<Plugins>
<ext:EditableGrid ID="EditableGrid1" runat="server" />
</Plugins>
<ColumnModel>
<Columns>
<ext:RowNumbererColumn />
<ext:Column Header="Value" DataIndex="Value" Width="130" Sortable="true">
<Editor>
<ext:ComboBox ID="cmb1" runat="server" TriggerAction="All">
<Items>
<ext:ListItem Text="1" Value="1" />
<ext:ListItem Text="2" Value="2" />
</Items>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column Header="Text" DataIndex="Text" Width="130" Sortable="true">
<Editor>
<ext:TextField ID="TextField1" runat="server" AllowBlank="false" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true"/>
</SelectionModel>
</ext:GridPanel>
</div>
</form>
</body>
</html>
Code Behindusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
namespace TestApp2010.Test
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.GridPanel1.Store.Primary.DataSource = new List<object>
{
new {
Value = 1,
Text = "One"
},
new {
Value = 2,
Text = "Two"
},
new {
Value = 3,
Text = "Three"
},
new {
Value = 4,
Text = "Four"
},
new {
Value = 5,
Text = "Five"
}
};
this.GridPanel1.Store.Primary.DataBind();
}
}
}
}