Perform Edit and delete using grid panel and effect should be refrected to sql server database.

  1. #1

    Perform Edit and delete using grid panel and effect should be refrected to sql server database.

    Below is my grid panel code:

    <ext:GridPanel ID="GridPanel1" Header="false" runat="server" Title="Array Grid" Width="600" Height="320">
                    <Store>
                        <ext:Store ID="Store1" runat="server" RemoteSort="false" OnReadData="MyData_Refresh">
                            <Model>
                                <ext:Model ID="Model1" runat="server" IDProperty="company">
                                    <Fields>
                                        <ext:ModelField Name="SocialID" />
                                        <ext:ModelField Name="SName" Type="String" />
                                        <ext:ModelField Name="SURL" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel ID="ColumnModel1" runat="server">
                        <Columns>
                            <ext:Column ID="Column1" Visible="false" runat="server" Text="StudentId" DataIndex="SocialID" Flex="1">
                            </ext:Column>
                            <ext:Column ID="Column2" runat="server" Width="75" DataIndex="SName">
                            </ext:Column>
                            <ext:Column ID="Column3" runat="server" Width="250" DataIndex="SURL">
                            </ext:Column>
                        </Columns>
                    </ColumnModel>
    
                </ext:GridPanel>
    Click image for larger version. 

Name:	image1.jpg 
Views:	39 
Size:	21.2 KB 
ID:	6080

    below code that i have wrote in code behind file to fill grid panel:
       protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                    BindSocial();
                }
            }
    
            protected void BindSocial()
            {
                if (!X.IsAjaxRequest)
                {
                    this.Store1.DataSource = SocialManager.GetSocialByP_PID(9);
                    this.Store1.DataBind();
    
                }
            }
    
            protected void MyData_Refresh(object sender, StoreReadDataEventArgs e)
            {
                BindSocial();
            }

    What I need is edit and delete button to perform edit functionality and delete functionality.
    Last edited by Daniil; Apr 23, 2013 at 5:31 AM. Reason: Please use [CODE] tags
  2. #2
  3. #3

    Perform Edit and delete using grid panel and effect should be refrected to sql server database.

    thanks for the reply.
    Click image for larger version. 

Name:	image1.jpg 
Views:	69 
Size:	21.2 KB 
ID:	6086

    Please check the image. I have this type of requirement.
    There are 2 button in each row of grid panel. If user clicks on delete system will show the confirmation message and if user click on ok than record "delete" from the database as well as from the grid panel.
    If user clicks on "edit" and a form will be open above the girdpanel in that user can see the record which he/she wants to edit. After modification user will click on save button to save changes.

    Note: For Insert new record and update existing record I am using form panel. I already performed Insert Operation.

    Please give me reply as soon as possible.
    Last edited by kavit@bdtpark.com; Apr 23, 2013 at 9:43 AM.
  4. #4
    Quote Originally Posted by kavit@bdtpark.com View Post
    There are 2 button in each row of grid panel. If user clicks on delete system will show the confirmation message and if user click on ok than record "delete" from the database as well as from the grid panel.
    To show a confirmation dialog you can use Ext.Msg.confirm().
    http://docs.sencha.com/extjs/4.2.0/#...method-confirm

Similar Threads

  1. [CLOSED] Edit and Delete Grid Rows with Permissions
    By pint in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 25, 2012, 10:24 AM
  2. Replies: 2
    Last Post: Dec 19, 2011, 1:54 AM
  3. Replies: 5
    Last Post: Jul 30, 2011, 6:40 PM
  4. Replies: 0
    Last Post: Sep 02, 2010, 3:58 AM
  5. Replies: 0
    Last Post: Jul 23, 2010, 6:35 AM

Tags for this Thread

Posting Permissions