4 Answers, 1 is accepted
0
Marc
Top achievements
Rank 1
answered on 14 Jun 2011, 02:00 PM
Dear all,
Nobody has a solution ?
I tested and it's working with previous version of TELERIK.
Thanks in advance
Marc
Nobody has a solution ?
I tested and it's working with previous version of TELERIK.
Thanks in advance
Marc
0
Hello Marc,
Julian Benkov
the Telerik team
Thank you for contacting us.
Currently, the RadTreeView contol does not support such functionality. The custom sorting and sorting using different properties of a bound object will be ready for our next release Q2 2011, planed for next month.
Let me know if you have further questions.
Julian Benkov
the Telerik team
0
Stephen McDaniel
Top achievements
Rank 1
answered on 16 Dec 2011, 02:27 AM
Has this been implemented yet? I just tried updating to Q3 2011 and I'm also having problems doing custom sorting like this.
0
Hi Stephen,
I hope this helps.
Regards,
Julian Benkov
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
The custom sorting and filtering operation for RadTreeView control is available in Q3 2011 SP1 which we have just released. In this version you can write a custom comparer:
public
SortedTreeView()
{
InitializeComponent();
for
(
int
i = 0; i < 100; i++)
{
RadTreeNode radTreeNode =
new
RadTreeNode(i.ToString());
radTreeView1.Nodes.Add(radTreeNode);
}
for
(
int
i = 0; i < 100; i++)
{
for
(
int
j = 0; j < 10; j++)
{
RadTreeNode radTreeNode =
new
RadTreeNode(i.ToString() +
"-"
+ j.ToString());
radTreeView1.Nodes[i].Nodes.Add(radTreeNode);
}
}
radTreeView1.TreeViewElement.Comparer =
new
MyComparer(
this
.radTreeView1.TreeViewElement);
}
private
bool
FilterNode(RadTreeNode node)
{
if
(node.Text.Length > 1)
{
return
true
;
}
return
false
;
}
private
void
radButton1_Click(
object
sender, EventArgs e)
{
//radTreeView1.SelectedNode.Remove();
this
.radTreeView1.Filter =
"Custom"
;
if
(radTreeView1.SortOrder == SortOrder.None)
{
radTreeView1.SortOrder = SortOrder.Ascending;
}
else
if
(radTreeView1.SortOrder == SortOrder.Ascending)
{
radTreeView1.SortOrder = SortOrder.Descending;
}
else
{
radTreeView1.SortOrder = SortOrder.None;
}
}
class
MyComparer : TreeNodeComparer
{
public
MyComparer(RadTreeViewElement treeView)
:
base
(treeView)
{
}
public
override
int
Compare(RadTreeNode x, RadTreeNode y)
{
if
(
this
.TreeViewElement.SortOrder == SortOrder.Descending)
{
return
x.Text.CompareTo(y.Text);
}
return
x.Text.CompareTo(y.Text) * -1;
}
}
I hope this helps.
Regards,
Julian Benkov
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.