View Full Version : [CLOSED] DirectEvent In Button Menu

Mar 03, 2014, 8:28 PM
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_S TRING(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>



Mar 04, 2014, 2:47 AM
Hi @ebeker,

Please try to set up

for the Menu.

Mar 04, 2014, 4:27 AM
works, cool thanx.