locked
FilterUserControl RRS feed

  • Question

  • User-1891935224 posted

    Om my Custom List.aspx Page , i tried to write code in  the  OnFilterSelectedIndexChanged event which is supposed to fire from the dynamicfilter OnSelectedIndexChanged.
    Then i noticed that the event was not fired. Looking in the  Filterusercontrol.ascx.vb (i am using vb) i found only the following line regarding the event.

    Public Custom Event SelectedIndexChanged As EventHandler

    Which i changed to this ...

    Public Custom Event SelectedIndexChanged As EventHandler

    AddHandler(ByVal value As EventHandler)

    AddHandler DropDownList1.SelectedIndexChanged, value

    End AddHandler

    RemoveHandler(ByVal value As EventHandler) RemoveHandler DropDownList1.SelectedIndexChanged, value

    End RemoveHandler

    RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End RaiseEvent

    End Event

     

    Now the event fires but the eventArgs returns Empty ... Any idea ?

    Monday, October 27, 2008 7:15 PM

Answers

  • User1641955678 posted

    You are quite right, the VB version of this file is broken, and your fix is correct.  We're using a translator to convert from C# to VB, and apparently it doesn't do the right thing with events.  We'll get a bug filed so we can address in the future.

    thanks!
    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 27, 2008 9:19 PM

All replies

  • User1641955678 posted

    You are quite right, the VB version of this file is broken, and your fix is correct.  We're using a translator to convert from C# to VB, and apparently it doesn't do the right thing with events.  We'll get a bug filed so we can address in the future.

    thanks!
    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 27, 2008 9:19 PM
  • User-1891935224 posted

    Ok David 

    , thanks for the quick verification.

    Flougr 

    Tuesday, October 28, 2008 6:28 AM
  • User-797310475 posted

    Now the event fires but the eventArgs returns Empty ... Any idea ?

    I know this is way late, but to follow up on the issue that the eventArgs return Empty: This is happening because essentially the way the implementation works is by forwarding the events fired from the underlying UI control (like the DropDownList declared in FilterUserControl) to the page that loads it. It is the DropDownList that fires its event using EventArgs.Empty and so that's why your event handler is getting them as empty. You should instead cast the sender and then inspect the relevant values to determine what the new state is.

    Tuesday, December 16, 2008 6:37 PM