[CLOSED] ImageCommand with DirectEvent

  1. #1

    [CLOSED] ImageCommand with DirectEvent

    Hi,
    The following code worked fine with Ext.Net 2.0 DP1 ... can you let me know where I'm going wrong now please (thanks).
    Error: Object reference not set to an instance of an object.


    Code Behind:

    protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.GridPanel1.Store.Primary.DataSource = new object[]
                {
                    new object[] { 1, "3m Co" },
                    new object[] { 2, "Alcoa Inc" },
                    new object[] { 3, "Altria Group Inc" },
                    new object[] { 4, "American Express Company" },
                    new object[] { 5, "American International Group, Inc." },
                };
    
    
                this.GridPanel1.Store.Primary.DataBind();
            }
        }
    
    
    
    
        protected void GridPanel1_Command(object sender, DirectEventArgs e)
        {
            X.MessageBox.Alert("Click", e.ExtraParams["Param"]).Show();
        }

    <ext:GridPanel 
            ID="GridPanel1"
            runat="server">
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Model>
                        <ext:Model ID="Model1" runat="server" IDProperty="id">
                            <Fields>
                                <ext:ModelField Name="id" Type="Int" />
                                <ext:ModelField Name="company" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel>
                <Columns>
                    <ext:ImageCommandColumn ID="ImageCommandColumn1" runat="server">
                            <Commands>
                                <ext:ImageCommand CommandName="Edit" Text="Edit" />
                            </Commands> 
                            <DirectEvents>                                       
                                <Command OnEvent="GridPanel1_Command">
                                    <ExtraParams>
                                        <ext:Parameter Name="id" Value="record.id" Mode="Raw"/>
                                    </ExtraParams>
                                </Command>
                            </DirectEvents>
                        </ext:ImageCommandColumn>
                    <ext:Column ID="Column1" runat="server" Text="Company" DataIndex="company" Flex="1" />
                </Columns>            
            </ColumnModel>
        </ext:GridPanel>
    Last edited by Daniil; Mar 10, 2012 at 12:02 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Thanks for the report, fixed in SVN. Please update from:
    http://svn.ext.net/premium/branches/2.0/

    It will be publicly available in Beta 2.
  3. #3
    Thanks Daniil ... I can confirm the SVN update works fine. You can close this thread.

    Adrian.

Similar Threads

  1. Replies: 5
    Last Post: Mar 19, 2014, 3:35 AM
  2. Replies: 1
    Last Post: Jun 09, 2011, 7:04 PM
  3. [CLOSED] Adding a button directevent in a directevent method
    By ogokgol in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 31, 2011, 10:29 AM
  4. Imagecommand IE6
    By dayanat in forum 1.x Help
    Replies: 3
    Last Post: Jun 25, 2009, 9:51 AM
  5. [CLOSED] ImageCommand Bug
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 04, 2009, 6:02 PM

Posting Permissions