When setting LineBreakMode properties in Label inside the TreeView ItemTemplate, the properties are not respected.
<treeview:TreeViewDescriptor
ItemsSourcePath="Children"
TargetType="{x:Type models:Folder}">
<treeview:TreeViewDescriptor.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="Auto, *, Auto">
<Label
Grid.Column="0"
FontFamily="MaterialIcons"
FontSize="22.0"
Text="Folder"
TextColor="Peru"
VerticalOptions="Center" />
<Label
Grid.Column="1"
Margin="6.0,0.0"
LineBreakMode="TailTruncation"
Text="Item with loooooooooooooooong naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaammmmmmmmmmmmmmeeeeeeeeeeeeee"
VerticalOptions="Center" />
<Button Text=". . ."
Grid.Column="2"
BackgroundColor="Transparent"
WidthRequest="64.0">
</Button>
</Grid>
</DataTemplate>
</treeview:TreeViewDescriptor.ItemTemplate>
</treeview:TreeViewDescriptor>
Workaround:
Change the Palette.
ChartPalette chartPalette = new ChartPalette();
chartPalette.Entries.Add(new PaletteEntry { FillColor = Colors.LightBlue, StrokeColor = Colors.LightGreen });
this.chart.Palette = chartPalette;
Application Crashes if we delay the column creations after the collection is set.
No crash if we remove the delay.
If I use the CellEditTemplate to show a custom view when editing - the view does not get auto focus when shown and the end user needs to tap inside so the view gets focus.
<telerik:DataGridTextColumn PropertyName="CountryName" HeaderText="Country">
<telerik:DataGridTextColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadEntry Text="{Binding Item.CountryName}" />
</DataTemplate>
</telerik:DataGridTextColumn.CellEditTemplate>
</telerik:DataGridTextColumn>
Work-around:
Manually invoke the Focus() method and set the cursor position when the view gets loaded and when it changes its visibility:
<telerik:RadEntry Text="{Binding Item.CountryName}"
Loaded="RadEntry_Loaded"
PropertyChanged="RadEntry_PropertyChanged" />
private void RadEntry_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(View.IsVisible))
{
RadEntry entry = (RadEntry)sender;
if (entry.IsVisible)
{
FocusEntry(entry);
}
}
}
private void RadEntry_Loaded(object sender, EventArgs e)
{
FocusEntry((RadEntry)sender);
}
private static void FocusEntry(RadEntry entry)
{
entry.Dispatcher.DispatchDelayed(TimeSpan.FromMilliseconds(1), () =>
{
entry.Focus();
entry.CursorPosition = entry.Text?.Length ?? 0;
});
}
Coerce items at later stage, as now when programmatically add items to Selected Items and Checked Items. and both collections are set before the ItemsSource, indication for selection and checked is not presented.
Issue:
<telerik:RadTreeView x:Name="treeView"
CheckBoxMode="Recursive" Grid.Row="1"
SelectedItems="{Binding CheckedItems, Mode=TwoWay}"
ItemsSource="{Binding Items}">
Work:
<telerik:RadTreeView x:Name="treeView"
CheckBoxMode="Recursive" Grid.Row="1"
ItemsSource="{Binding Items}"
SelectedItems="{Binding CheckedItems, Mode=TwoWay}">
When cell is in edit mode, pressings enter key calls infinitely CommitEdit Execute method in custom scenario.
1. When new item is added to the DataGrid source, the cell goes in edit mode
2. Pressing enter key executes additional logic and CommitEdit Execute method calls infinitely.
Workaround:
Inside the CommitEdit CanExecure method, call the default can execute logic
public override bool CanExecute(object parameter)
{
return this.Owner.CommandService.CanExecuteDefaultCommand(DataGridCommandId.CommitEdit, parameter);
//return true;
}