none
How to do GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler" by code

    Question

  • Hi,

    I need to setup and event handler to the gridviewcolumntheader click because i haver grivviewcolumns defined by code.

    The only example of data sorting of this kind uses this event defined in XAML but i cant see it in the C# side.

    What's the trick?

    Thx,

    Nuno
    Sunday, December 09, 2007 2:14 AM

Answers

  • You can do

    MyListView.AddHandler(GridViewColumnHeader.ClickEvent,new RoutedEventHandler(GridViewColumnHeaderClickedHandler));

     

    void GridViewColumnHeaderClickedHandler(object sender, RoutedEventArgs e)

    {

    MessageBox.Show("testing");

    }

    Sunday, December 09, 2007 10:35 AM

All replies

  • You can do

    MyListView.AddHandler(GridViewColumnHeader.ClickEvent,new RoutedEventHandler(GridViewColumnHeaderClickedHandler));

     

    void GridViewColumnHeaderClickedHandler(object sender, RoutedEventArgs e)

    {

    MessageBox.Show("testing");

    }

    Sunday, December 09, 2007 10:35 AM
  •  

    Hi,

     

    Thx. How can I now this by the reference?

     

    I couldnt imagine that this exists.

     

    Thx,

     

    Nuno

     

     

    Sunday, December 09, 2007 11:24 AM