[CLOSED] DirectEvent In Button Menu

  1. #1

    [CLOSED] DirectEvent In Button Menu

    I have a form with gridpanel,
    here is my DirectEvent in Code Behind
     Public Sub SaveItemStatus()
                Dim SelectedItems As String = Nothing
                Dim smt As RowSelectionModel = TryCast(Me.gpanel1.SelectionModel.Primary, RowSelectionModel)
                For Each rowt As SelectedRow In smt.SelectedRows
                    SelectedItems = SelectedItems & "," & rowt.RecordID
                SelectedItems = Mid(SelectedItems, 2, SelectedItems.Length)
                ezmanHelper.orders.SP_UPDATE_ORD_ITEM_STATUS_VIA_STRING(SelectedItems, Users.CurrentUserId, cmbItemStatus.SelectedItem.Value)
            Catch ex As Exception
                Ext.Net.X.Msg.Alert("Response", "Please try again or contact to administrator.<br>" & ex.Message).Show()
            End Try
        End Sub
    When i fire above directevent from any button in the form the FOR LOOP works and it gives me the ROW IDs AS i expected.

    but When i put my button in a menu panel,FOR LOOP is not working and throwing exception "Object reference not set to an instance of an object". Below is the menu button that Fires the directevent but FOR LOOP can not access to my gridpanels selected row list
      <ext:Button ID="btnChangeItemStatus" Hidden="true" runat="server" Icon="StyleGo" Text="Change Item Status">
                                                            <ext:Menu ID="Menu2" runat="server" Width="250" Layout="FormLayout" ShowSeparator="false">
                                                                    <ext:ComboBox Width="180" runat="server" DisplayField="OrdItemStatusTypeName" ValueField="OrdItemStatusTypeId" Text="Select Status" ID="ComboBox2">
                                                                            <ext:Store runat="server" DataSourceID="dtsItemsStatus" ID="store2">
                                                                                    <ext:Model runat="server" ID="model7" IDProperty="OrdItemStatusTypeId">
                                                                                            <ext:ModelField Name="OrdItemStatusTypeId" Type="Int"></ext:ModelField>
                                                                                            <ext:ModelField Name="OrdItemStatusTypeName" Type="String"></ext:ModelField>
                                                                    <ext:Button Width="180"  runat="server" ID="Button2" Icon="Accept" Text="Save">
                                                                            <Click OnEvent="SaveItemStatus">
                                                                                <EventMask ShowMask="true" UseMsg="true" Msg="Please wait while items' status changing....."></EventMask>
    Last edited by Daniil; Mar 04, 2014 at 4:46 AM. Reason: [CLOSED]
  2. #2
    Hi @ebeker,

    Please try to set up
    for the Menu.
  3. #3
    works, cool thanx.

Similar Threads

  1. Replies: 5
    Last Post: Mar 19, 2014, 3:35 AM
  2. Replies: 1
    Last Post: Jan 15, 2014, 4:47 AM
  3. Replies: 6
    Last Post: May 15, 2013, 10:07 AM
  4. [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
  5. Replies: 2
    Last Post: Oct 22, 2010, 11:04 AM

Posting Permissions