or
I sent a support ticket to the telerik admins asking if there were any API methods to determine if the caret is at the start and end of a line.
They responded with a solution so I thought I should share it with everyone else.
Is Caret at Line Start
public
static
bool
IsCaretAtLineStart(RadDocument document)
{
DocumentPosition endLinePosition =
new
DocumentPosition(document.CaretPosition);
endLinePosition.MoveToCurrentLineStart();
if
(document.CaretPosition == endLinePosition)
{
return
true
;
}
return
false
;
}
Is Caret at Line End
public
static
bool
IsCaretAtLineEnd(RadDocument document)
{
DocumentPosition endLinePosition =
new
DocumentPosition(document.CaretPosition);
endLinePosition.MoveToCurrentLineEnd();
if
(document.CaretPosition == endLinePosition)
{
return
true
;
}
return
false
;
}
I hope this helps you as it did myself.
Thanks,
Rob
Hi, I'm trying to use the RadMaskedNumericInput as follows;<
telerik:RadMaskedNumericInput
Grid.Row
=
"6"
Grid.Column
=
"1"
Value
=
"{Binding Mileage}"
EmptyContent
=
"kilometer"
FormatString
=
"D"
Mask
=
"d"
IsClearButtonVisible
=
"False"
VerticalAlignment
=
"Center"
VerticalContentAlignment
=
"Center"
/>
<
telerik:RadGridView
x:Name
=
"myListView"
IsReadOnly
=
"{Binding Path=pending, Converter={StaticResource booleanToInverseConv}}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewColumn
Header
=
""
IsFilterable
=
"False"
HeaderCellStyle
=
"{StaticResource estiloDaColuna}"
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
Button
Style
=
"{DynamicResource ImageButtonStyle}"
Tag
=
"{Binding Path=id}"
x:Name
=
"btnRemoveProduto"
Width
=
"20"
Click
=
"removeProduto_Click"
Height
=
"20"
>
<
Image
Source
=
"..\..\..\Icons\delete_red.png"
Stretch
=
"Fill"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
/>
</
Button
>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
<
telerik:GridViewDataColumn
IsFilterable
=
"False"
IsReadOnly
=
"True"
Header
=
"Desconto 2"
DataMemberBinding
=
"{Binding desconto2}"
DataFormatString
=
"{}{0:N2}%"
Width
=
"90"
HeaderCellStyle
=
"{StaticResource estiloDaColuna}"
FooterCellStyle
=
"{StaticResource GridViewCellStyleLeft}"
>
<
telerik:GridViewDataColumn.Footer
>
<
StackPanel
>
<
Label
Content
=
"Ola"
></
Label
>
<
Label
Content
=
"{Binding Path=Descontos}"
></
Label
>
</
StackPanel
>
</
telerik:GridViewDataColumn.Footer
>
When I insert a large jpeg into the richtextbox, the editor chops off the right side of the image to fit into the richtextbox without a horizontal scrollbar. What I need is a way to make the richtextbox expands to fit the image.
<
telerik:RadRichTextBox
HorizontalAlignment
=
"Stretch"
LayoutMode
=
"Flow"
x:Name
=
"editor"
AllowDrop
=
"True"
Drop
=
"editor_Drop"
ShowComments
=
"False"
BorderBrush
=
"Transparent"
BorderThickness
=
"0"
IsSelectionMiniToolBarEnabled
=
"False"
IsContextMenuEnabled
=
"True"
IsInHeaderFooterEditMode
=
"False"
DocumentPresentationChanged
=
"EditorDocumentContentChanged"
LostFocus
=
"editor_LostFocus"
SizeChanged
=
"editor_SizeChanged"
HorizontalScrollBarVisibility
=
"Disabled"
>
</
telerik:RadRichTextBox
>
private
void
editor_SizeChanged(
object
sender, SizeChangedEventArgs e)
{
this
.editor.UpdateEditorLayout();
}
Hi,
It is somehow possible to display/edit an EntityCollection of entities?
My entity looks like that:
public
partial
class
Property : EntityObject
{....
public
string
Name {
set
;
get
}
public
string
Description {
set
;
get
}
public
string
Value{
set
;
get
}
public
string
RegExValidationString{
set
;
get
}
}
And I want to be able to edit a collection, each object in the collection to be displayed as an row in the PropertyGrid:
EntityCollection<Property> entityCollection =
new
EntityCollection<Property>();
entityCollection.Add(
new
Property() { Name =
"test1"
, Description =
"test1 description"
, Value =
"111"
});
entityCollection.Add(
new
Property() { Name =
"test2"
, Description =
"test2222 description"
, Value =
"lallla"
});
foreach
(Property p
in
entityCollection)
{
PropertyDefinition pd =
new
PropertyDefinition()
{
Binding =
new
Binding { Source = p.Value },
DisplayName = p.Name,
Description = p.Description
};
radPropertyGrid.PropertyDefinitions.Add(pd);
}
<telerik:RadDataForm CurrentItem="{Binding CurrentItem,ElementName=RadGridView1}"
no luck so far. Any simple solution to this ?
thankyou