3 Answers, 1 is accepted
0

Lasse
Top achievements
Rank 1
answered on 23 Jun 2014, 09:44 AM
In case others have the same requirement as I did; I manged to find a "hack" using reflection. It's definitely not pretty, but it works...
var tableBordersDialog = (TableBordersDialog
as
TableBordersDialog);
if
(tableBordersDialog ==
null
)
return
;
var tableBordersProperties = tableBordersDialog.FindName(
"tableBordersControl"
)
as
TableBordersProperties;
if
(tableBordersProperties ==
null
)
return
;
var tableBordersSelector = tableBordersProperties.FindName(
"borderSelector"
)
as
TableBorderSelector;
if
(tableBordersSelector ==
null
)
return
;
FieldInfo fieldInfo =
typeof
(TableBorderSelector).GetField(
"bordersList"
, BindingFlags.Instance | BindingFlags.NonPublic);
if
(fieldInfo ==
null
)
return
;
var field = fieldInfo.GetValue(tableBordersSelector);
var borderList = field
as
IList;
if
(borderList ==
null
)
return
;
if
(borderList.Count == 9)
//Initially the list has 9 known items.
{
//We need to remove the 3 not applicable
borderList.RemoveAt(5);
//DotDotDash
borderList.RemoveAt(4);
//DotDash
borderList.RemoveAt(2);
//DashSmallCap
fieldInfo.SetValue(tableBordersSelector, field);
}
0
Accepted
Hello Lasse,
All dialogs that come out of the box with RadRichTextBox are fully customizable. You can create a custom dialog and with the help of MEF force the control to load it instead of the default one. The attached application shows how this can be achieved. The custom dialog in it contains the code of the default one, so you can customize it to fit your needs.
I hope this helps.
Regards,
Petya
Telerik
All dialogs that come out of the box with RadRichTextBox are fully customizable. You can create a custom dialog and with the help of MEF force the control to load it instead of the default one. The attached application shows how this can be achieved. The custom dialog in it contains the code of the default one, so you can customize it to fit your needs.
I hope this helps.
Regards,
Petya
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0

Lasse
Top achievements
Rank 1
answered on 23 Jun 2014, 05:18 PM
Thank you for the reply. I would rather not have to maintain my own version of the build in dialog. So will stick with the solution using reflection until I have trouble with it.