Icon="Calendar" Primary="true" - both of the properties tell it does not exist in the current context.
1 Answer, 1 is accepted
0
Georgi
Telerik team
answered on 30 Aug 2023, 11:30 AM
Hello, Karthik,
Based on the Button configuration, I understand you might be upgrading from an older version.
There were breaking changes to the Icons in version 4.0.0. Due to this, currently, the Icon parameter accepts a member of the FontIcon enum or a property of the static SvgIcon class and it is set like this:
Additionally, the IconClass was removed in version 4.0.0. Currently, to use a custom icon, you can create a CSS class and then pass it to the Icon parameter:
<style>.my-icon {
/* define a background image or a custom font icon here */background: purple;
/* dimensions and other base styles will usually come from another class */width: 1em;
height: 1em;
font-size: 16px;
}
</style><TelerikButtonIcon="@( "my-icon" )">Custom Icon</TelerikButton>
Lastly, due to the breaking changes in 3.0.0, the Primary parameter was removed in favour of ThemeColor of type string. You can use the old primary Button styling like this: