NTreeList Sortable NTreeListColumn property issue


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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


Craig Swearingen
Craig Swearingen
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
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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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
Craig Swearingen
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
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?


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search