This is a migrated thread and some comments may be shown as answers.

Sort column highlighting

6 Answers 109 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 27 Jan 2016, 10:55 AM

Hi,

On the RadGrid there is a css style that you can use to give a deeper shade to the sorted column.  Is there an eqivalent for the TreeList?  Looking at the CSS I couldn't find one...

Regards

Jon

6 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 01 Feb 2016, 12:11 PM
Hello Jon,

Your assumption is correct. Currently this behavior is no built-in for the RadTreeList. You can log it as a feature request in our improvements portal and the dev team may consider implementing it for the upcoming releases:
http://feedback.telerik.com/Project/108


If you prefer, I can create a new sample web site to demonstrate a possible workaround and send it to you.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jon
Top achievements
Rank 1
answered on 01 Feb 2016, 01:12 PM

Hi Eyup,

Would the work around be a nice easy one?  If so yes please.  Otherwise it's not a major concern for me but could see that others might need it

Regards

Jon

0
Eyup
Telerik team
answered on 04 Feb 2016, 09:32 AM
Hello Jon,

You can try the following approach:
protected void RadTreeList1_PreRender(object sender, EventArgs e)
{
    foreach (string colName in RadTreeList1.SortExpressions
        .Cast<TreeListSortExpression>().Select(x => x.FieldName))
    {
        foreach (TreeListDataItem item in RadTreeList1.Items)
        {
            TableCell cell = item[colName];
            cell.BackColor = System.Drawing.Color.Lime;
        }
    }
}

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jon
Top achievements
Rank 1
answered on 04 Feb 2016, 12:52 PM

Thanks Eyup, 

That looks like it should do the job however I'm using VB.NET and am not sure how to change that cast expression over.  I've had a few goes and each is proving a failure, could you do the code in VB please?

 Many thanks,

Jon

0
Eyup
Telerik team
answered on 09 Feb 2016, 11:58 AM
Hi Jon,

You can try the following snippet:
Protected Sub RadTreeList1_PreRender(sender As Object, e As EventArgs)
    For Each colName As String In RadTreeList1.SortExpressions.Cast(Of TreeListSortExpression)().[Select](Function(x) x.FieldName)
        For Each item As TreeListDataItem In RadTreeList1.Items
            Dim cell As TableCell = item(colName)
            cell.BackColor = System.Drawing.Color.Lime
        Next
    Next
End Sub

As generated by the http://converter.telerik.com/.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jon
Top achievements
Rank 1
answered on 09 Feb 2016, 12:30 PM

Many thanks Eyup, that worked although I think yesterday I had something similar but hadn't added in the linq reference !  Oops.

 

Tags
TreeList
Asked by
Jon
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Jon
Top achievements
Rank 1
Share this question
or