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

how to change insert/update/delete icons to use bootstrap glyphicons on my RadTreeList

2 Answers 710 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
ck
Top achievements
Rank 1
ck asked on 12 Jan 2015, 04:48 PM
using telerik v.2014.3.1024.45 with ASP.NET 4.5
How can i use the boostrap glyphicons for my edit / insert / delete buttons?
so far i have used this

                    <telerik:TreeListEditCommandColumn UniqueName="InsertCommandColumn" ButtonType="ImageButton" ShowAddButton="true" ShowEditButton="true" HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="Center">

but i cannot find a simple way to change the icons.

let me know please
thanks

2 Answers, 1 is accepted

Sort by
0
Venelin
Telerik team
answered on 15 Jan 2015, 09:26 AM
Hello ck,

Since you are using the latest version of the controls, then you can set the render mode of RadTreeList to lightweight: RenderMode="Lightweight". After doing so the rendering will change in order to support glyph icons. One more change that you need is, instead of using EditCommandColumn, use this:

ASPX:

<telerik:TreeListButtonColumn CommandName="Delete" ButtonType="LinkButton" ButtonCssClass="CustomeDeleteButton rtlIcon" ></telerik:TreeListButtonColumn>

The reason for this change is that the EditCommandColumn still renders an <input> element, which can't have a font-icon. We will improve this, but you should be perfectly ok with the another approach. rtlIcon is predefined class, don't change its name, the another one can have another name, this one is just an example.

CSS:

@font-face {
    /*see bootstrap documentation*/
}
.RadTreeList .rtlIcon {
    /*the bootstrap font, see bootstrap documentation*/
}
.CustomeDeleteButton {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 1px solid red;
}
/*For DELETE*/
.RadTreeList .rtlIcon.CustomeDeleteButton:before {
    content: '\E035'; /*example value*/
}
/*for INSERT/ADD*/
div.RadTreeList .rtlAddIcon:before {
    content: '\E035'; /*example value*/
}
 
/*for EDIT*/
div.RadTreeList .rtlEditIcon:before {
    content: '\E035'; /*example value*/
}


After properly including the bootstrap font in your project, then you simply need to overwrite the example values above with the ones that correspond on the proper Bootstrap icons you would like to use.

Regards,
Venelin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
ck
Top achievements
Rank 1
answered on 15 Jan 2015, 10:06 AM
yeah thanks. it sounds a bit over complicated. I ended up extracting the bootstrap glyphicons into pngs and using them in image buttons.
Tags
TreeList
Asked by
ck
Top achievements
Rank 1
Answers by
Venelin
Telerik team
ck
Top achievements
Rank 1
Share this question
or