Doubt regarding ExtJS.Net and Asp.Net controls

  1. #1

    Doubt regarding ExtJS.Net and Asp.Net controls

    Hi


    can any one clear the following doubts

    1) On click of ext.net button can i bind asp.net grid controls. if so how can i do it
    2) Can ext.net gridpanel has property "enableViewstate"


    i am facing issue when combining ext.net controls and .net controls(charts ), we are using 1.3 ext.net in the projects


    Regards
    Praveen
  2. #2
    Hi,

    1. If you need to update a non-Ext.NET control during a DirectEvent or DirectMethod, please call .Update() on that asp.net control. This will regenerate the control and render the updated state to the Page.

    2. You shouldn't need ViewState. By default, ViewState is not sent to the server or browser. If you absolutely must include ViewState in the Request/Response, please set ViewStateMode="Enabled" on the DirectEvent config.

    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3

    grid.update() is not working for DirectEvent or DirectMethod of extJs.net button click

    HI ,

    Thank you for your reply , but grid.update() is not working for DirectEvent or DirectMethod of ext.net button click

    Please reply as soon as possible

    below is the example for sample code...it not working

    <%@ Page Language="C#" AutoEventWireup="true" %>

    <%@ Import Namespace="System.Xml" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

    <script runat="server">
    public class Programs
    {
    public string ProgramId { get; set; }
    public string ProgramName { get; set; }

    }

    private void BindDotNet()
    {
    List<Programs> list = new List<Programs>(5);

    for (int i = 1; i <= 5; i++)
    {
    Programs prog = new Programs
    {
    ProgramId = i.ToString(),
    ProgramName = ("Program Name" + i)
    };

    list.Add(prog);
    }


    grdAvailablePrograms.DataSource = list;
    grdAvailablePrograms.DataBind();
    grdAvailablePrograms.Update();
    }

    private void BindExtJsDotNet()
    {
    List<Programs> list = new List<Programs>(5);

    for (int i = 1; i <= 5; i++)
    {
    Programs prog = new Programs
    {
    ProgramId = i.ToString(),
    ProgramName = ("Program Name" + i)
    };

    list.Add(prog);
    }

    strAvailablePrograms.DataSource = list;
    strAvailablePrograms.DataBind();
    }

    protected void btnBothView_click(object sender, DirectEventArgs e)
    {
    BindExtJsDotNet();
    BindDotNet();

    }
    [DirectMethod]
    public void HelloMasterPage()
    {
    BindExtJsDotNet();
    BindDotNet();
    }
    </script>

    <!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 id="Head1" runat="server">
    <title>Submit MultiSelect Values - Ext.NET Examples</title>
    <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <form id="Form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Store ID="strAvailablePrograms" runat="server">
    <Reader>
    <ext:JsonReader>
    <Fields>
    <ext:RecordField Name="ProgramId" />
    <ext:RecordField Name="ProgramName" />
    </Fields>
    </ext:JsonReader>
    </Reader>
    </ext:Store>
    <table border="0">
    <tr>
    <td style="vertical-align: middle; padding-top: 10px">
    <ext:Button ID="Button1" Itcon="ResultsetNext" runat="server" Width="25" Text="EXTJS.NET and ASP.NET EVENT using Direct Events">
    <DirectEvents>
    <Click OnEvent="btnBothView_click" />
    </DirectEvents>
    </ext:Button>
    </ext:MultiSelect>
    </td>
    <td style="vertical-align: middle; padding-top: 10px">
    <ext:Button ID="Button12" Itcon="ResultsetNext" runat="server" Width="25" Text="EXTJS.NET and ASP.NET EVENT using Direct Method">
    <Listeners>
    <Click Handler="Ext.net.DirectMethods.HelloMasterPage();" />
    </Listeners>
    </ext:Button>
    </td>
    </tr>
    <tr>
    <td style="vertical-align: top;">
    <ext:MultiSelect ID="mltAvailablePrograms" runat="server" Legend="ExtJS.NET Control"
    AppendOnly="true" DragGroup="grp1" Width="300" Height="250" DisplayField="ProgramName"
    ValueField="ProgramId" StoreID="strAvailablePrograms">
    </ext:MultiSelect>
    </td>
    <td style="vertical-align: top;">
    <fieldset>
    <legend>ASP.NET Grid Controls</legend>
    <asp:GridView ID="grdAvailablePrograms" runat="server" AutoGenerateColumns="true">
    </asp:GridView>
    </fieldset>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    Last edited by praveencat123; Oct 13, 2012 at 10:40 AM. Reason: added sample code

Similar Threads

  1. doubt with GridCommand
    By lucasbarrios2 in forum 1.x Help
    Replies: 0
    Last Post: May 14, 2012, 6:14 PM
  2. License doubt
    By joao.msdn in forum Licensing
    Replies: 5
    Last Post: Mar 24, 2011, 5:12 AM
  3. Replies: 1
    Last Post: Oct 15, 2010, 7:05 AM
  4. EXTJS combined with Coolite Controls
    By simbal in forum 1.x Help
    Replies: 2
    Last Post: Apr 05, 2009, 5:55 PM
  5. Replies: 2
    Last Post: Oct 13, 2008, 4:08 AM

Tags for this Thread

Posting Permissions