Profile Picture

NTreeList Sortable NTreeListColumn property issue

Posted By Craig Swearingen 12 Years Ago
Author
Message
Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

I'm using the NTreeList with build 11.12.14.12.  One of my columns is specified like this:

col = new NTreeListColumn();

col.Width = 25;

col.Name = COLUMN_COUNTRYIMAGE;

col.Header.Text = string.Empty;

col.Sortable = false;

tl.Columns.Add(col);

The column shows images on the nodes and the column header is blank.  Though I've specified Sortable to be false when the user clicks on that column header it will highlight the column and show the appropriate ascending/descending glyph.  How do I stop this sort activity from being allowed?



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hello Craig,

You need to attach to NTreeList.ColumnNotify event and in the event handler to do the following:

void nTreeList1_ColumnNotify(object sender, NTreeListColumnNotifyData data)
{
   if (data.NotifyCode == NTreeList.ColumnSortingNotifyCode)
   {
      data.Cancel = true;
   }
}

If you need this only for certain column(s) you need to check the column along with the notify code:

if (data.NotifyCode == NTreeList.ColumnSortingNotifyCode && data.Column == col) ...

Best Regards,
Nevron Support Team



Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

Thanks, that worked.  So I set it like this:

private void TreeList_ColumnNotify(object sender, NTreeListColumnNotifyData data)

{

if ((data.NotifyCode == NTreeList.ColumnSortingNotifyCode) && !data.Column.Sortable)

{

data.Cancel = true;

}

}

Please let me know if I should not use the Sortable property like this.



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
You can use Sortable to check whether the column can be sorted, but you need first explicitly set this property for the desired columns.

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic