Row Editor

Posted: Mon, May 28, 2012 - 04:03pm

HI This is Nagesh

          I have Retrieve the data into gridpanel from database, and i used the RowEditor like

          <Plugins>

                <ext:RowEditor ID="RowEditor1" runat="server" SaveText="Update" />

            </Plugins>

Now i want to update the Row , how can i pic the row cell to edit the data of database(sqlserver).

 Can anybody Help me the serverside code...

I got It

  • Tue, May 29, 2012 - 01:19pm

hai i got that Row editor code...

Hi @abdhullahmirza501

  • Thu, Nov 29, 2012 - 07:12pm

Hi @abdhullahmirza501

see below code for row editing

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RowEditing.ascx.cs" Inherits="Desktop_RowEditing" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">

 protected void Page_Load(object sender, EventArgs e)
    {

       SqlConnection cn = new SqlConnection(WebConfigurationManager.ConnectionStrings["con"].ConnectionString);
        string c = "select * from login";

        SqlCommand cmd = new SqlCommand(c, cn);
        cn.Open();
        str2 = this.Gridp.GetStore();
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet ds = new DataSet();
        da.Fill(ds);
        str2.DataSource = ds;
        str2.DataBind();
        cn.Close();
    }
   
    public void click(object sender,EventArgs e)
    {
        cn.Open();
        SqlCommand cmd = new SqlCommand("update login set name='" + m2.Text + "',pwd='" + m3.Text + "'  where id='" + m1.Text + "'", cn);
        cmd.ExecuteNonQuery();
        cn.Close();
      
    }

</script>
<ext:DesktopModuleProxy ID="DesktopModuleProxy6" runat="server">
    <Module ModuleID="Form4">
        <Shortcut Name="RowEditing" IconCls="x-grid-shortcut" SortIndex="1">
        </Shortcut>
        <Launcher ID="ll" Text="RowEditing" Icon="Table">
        </Launcher>
        <Window>
            <ext:Window ID="window6" runat="server" Icon="Table" Width="430" Height="250" AnimCollapse="false"
                ConstrainHeader="true" Title="Editing">
                <Items>
                    <ext:GridPanel ID="Gridp" runat="server" Height="200" Title="Title">
                        <Store>
                            <ext:Store ID="str2" runat="server">
                                <Model>
                                    <ext:Model ID="mdl2" runat="server">
                                        <Fields>
                                            <ext:ModelField Name="id">
                                            </ext:ModelField>
                                            <ext:ModelField Name="name">
                                            </ext:ModelField>
                                            <ext:ModelField Name="pwd">
                                            </ext:ModelField>
                                        </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="cmd2" runat="server">
                            <Columns>
                                <ext:Column ID="cm1" runat="server" DataIndex="id" Text="Id">
                                    <Editor>
                                        <ext:TextField ID="m1" runat="server" Selectable="false">
                                        </ext:TextField>
                                    </Editor>
                                </ext:Column>
                                <ext:Column ID="cm2" runat="server" DataIndex="name" Text="Name">
                                    <Editor>
                                        <ext:TextField ID="m2" runat="server">
                                        </ext:TextField>
                                    </Editor>
                                </ext:Column>
                                <ext:Column ID="cm3" runat="server" DataIndex="pwd" Text="Pwd">
                                    <Editor>
                                        <ext:TextField ID="m3" runat="server">
                                        </ext:TextField>
                                    </Editor>
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <Plugins>
                            <ext:RowEditing ID="ree1" runat="server" SaveBtnText="Save" ClicksToEdit="1">
                            <DirectEvents>
                            <Edit OnEvent="click"></Edit>
                            </DirectEvents>
                           
                            </ext:RowEditing>
                        </Plugins>
                        <BottomBar>
                            <ext:PagingToolbar ID="ptt1" runat="server">
                            </ext:PagingToolbar>
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:Window>
        </Window>
    </Module>
</ext:DesktopModuleProxy>

Otherwise see the below URL it will help you

http://examples.ext.net/#/GridPanel/Plugins/RowEditor/.

Nagesh, did you find the

  • Tue, Jan 01, 2013 - 09:42pm

Nagesh, did you find the solution?

__________________

Rahul Singla
Signature

Hi rahul

  • Wed, Jan 02, 2013 - 01:47pm

Hi @rahul,

yes i got the solution, check my previous reply.

Okay thanks!!

  • Wed, Jan 02, 2013 - 07:28pm

Okay thanks!!

__________________

Rahul Singla
Signature