View Issue Details

IDProjectCategoryView StatusLast Update
0000937NoesisGUIUnity3Dpublic2019-10-17 10:16
ReporterXaeroDegreazAssigned Tosfernandez 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.2.6f5 
Target Version2.2.6Fixed in Version2.2.6 
Summary0000937: Click events are not registered on GridViewColumnHeader objects.
DescriptionI'm trying to latch on to the click events of GridViewColumnHeader objects for sorting data in a ListView.

The click even does not fire under normal circumstances. If I set the GridViewColumnHeader.ClickMode to "Press" then it will work every 2nd mouse click. It seems to work 100% of the time with Hover.

I've tried other mouse events but nothing seems to be working reliably.


I read the post at http://www.noesisengine.com/forums/viewtopic.php?f=3&t=168&p=936&hilit=clickmode#p936 but it is quite dated and I'm not sure if there was a resolution or not.
Steps To ReproduceXAML:
<ListView x:Name="gameList" Margin="10,10,10,482">
    <ListView.View>
        <GridView x:Name="gridView">
            <GridViewColumn DisplayMemberBinding="{Binding Host}">
                <GridViewColumn.Header>
                    <GridViewColumnHeader Tag="Host">Host</GridViewColumnHeader>
                </GridViewColumn.Header>
            </GridViewColumn>
            <GridViewColumn DisplayMemberBinding="{Binding GameName}">
                <GridViewColumn.Header>
                    <GridViewColumnHeader Tag="Game Name">Game Name</GridViewColumnHeader>
                </GridViewColumn.Header>
            </GridViewColumn>
            <GridViewColumn DisplayMemberBinding="{Binding Players}">
                <GridViewColumn.Header>
                    <GridViewColumnHeader Tag="Players">Players</GridViewColumnHeader>
                </GridViewColumn.Header>
            </GridViewColumn>
        </GridView>
    </ListView.View>
</ListView>

C#:
var gridView = (GridView) gameList.FindName( "gridView" );
foreach ( var column in gridView.Columns )
{
    var c = (GridViewColumn) column;
    var h = (GridViewColumnHeader) c.Header;
    h.Click+= ( sender, args ) => { throw new System.NotImplementedException(); };
}
TagsNo tags attached.
PlatformAny

Relationships

related to 0001499 resolvedsfernandez GridViewColumnHeader Click event not raised 

Activities

XaeroDegreaz

XaeroDegreaz

2016-08-26 04:23

reporter   ~0004098

I was able to get it to work by using ClickMode=Press and explicitly calling ReleaseMouseCapture() on the sender:

var gridView = (GridView) gameList.FindName( "gridView" );
var cols = gridView.Columns.Cast<GridViewColumn>().ToList();
cols.ForEach( c =>
{
    GridViewColumnHeader h = (GridViewColumnHeader) c.Header;
    h.ClickMode = ClickMode.Press;
    h.Click += ( sender, args ) =>
    {
        Debug.Log( sender );
        ((GridViewColumnHeader)sender).ReleaseMouseCapture();
    };
} );

Issue History

Date Modified Username Field Change
2016-08-26 03:48 XaeroDegreaz New Issue
2016-08-26 04:23 XaeroDegreaz Note Added: 0004098
2016-10-04 23:21 sfernandez Assigned To => sfernandez
2016-10-04 23:21 sfernandez Status new => assigned
2018-11-01 02:14 jsantos View Status public => private
2018-11-23 01:47 sfernandez View Status private => public
2018-11-23 01:47 sfernandez Platform => Any
2019-06-19 19:40 sfernandez Relationship added related to 0001499
2019-10-16 23:48 sfernandez Target Version => 2.2.6
2019-10-17 10:16 sfernandez Status assigned => resolved
2019-10-17 10:16 sfernandez Resolution open => fixed
2019-10-17 10:16 sfernandez Fixed in Version => 2.2.6