When the selected item is set initially, the selected style is not applied to the row/cell.
Workaround: You can use a Dispatcher to workaround the issue, code looks as follows:
this.Dispatcher.StartTimer(TimeSpan.FromMilliseconds(200), () =>
{
if (dataGrid.SelectedItem == null)
{
dataGrid.SelectItem(viewModel.PersonCollection.First());
}
return false;
});
When uprating the row details data, the data does not update in the UI. You have to resize the window, or collapse then expand the row details to see the updated value.
The behavior happens in 7.0.0 version. In 6.8.0 it works as expected.
TapGestureRecognizer not working correctly when tapping inside the DataGrid control on iOS and MacCatalyst platforms.
Workaround:
You could use CellTap or CellDoubleTap commands of the DataGrid control. Here are the links to our documentation articles: DataGrid Commands and DataGrid CellTap Command.
I have the following issues when there is a DataGrid inside RowDetails template
1. The + does not change to - after expanding the details
2. Clicking the header in the inner data grid of line 2 does not work (seems disabled)
3. Sometimes cannot edit the inner DataGrid. tapping 2 times on the cell does not enter in edit mode
I am using NavigationPages and Dependency Injection (for the Pages and ViewModels) to navigate (not AppShell).
<Grid RowDefinitions="*,100">
<telerik:RadDataGrid x:Name="grdRegisters"
RowHeight="50"
Style="{StaticResource ReadOnlyGridStyle}"
ItemsSource="{Binding Registers}"
SelectionStyle="{StaticResource SelectedRowBackgroundStyle}"
RowBackgroundStyle="{StaticResource RowBackgroundStyle}"
AlternateRowBackgroundStyle="{StaticResource AltRowBackgroundStyle}"
SelectedItem="{Binding SelectedRegister, Mode=TwoWay}">
<telerik:RadDataGrid.Columns>
<telerik:DataGridTemplateColumn HeaderText=""
SizeMode="Fixed"
Width="50">
<telerik:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate x:DataType="RegisterModel">
<Label FontFamily="FASolid"
HorizontalOptions="Center"
VerticalOptions="Center"
Text=""
IsVisible="{Binding IsCurrentRegister, Mode=OneTime}"/>
</DataTemplate>
</telerik:DataGridTemplateColumn.CellContentTemplate>
</telerik:DataGridTemplateColumn>
<telerik:DataGridTemplateColumn HeaderText="Shift Date">
<telerik:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate x:DataType="RegisterModel">
<Label Style="{StaticResource GridCellLabelStyle}"
Text="{Binding Date, Converter={StaticResource ToLocalTimeConverter}, StringFormat='{}{0:d}'}"/>
</DataTemplate>
</telerik:DataGridTemplateColumn.CellContentTemplate>
</telerik:DataGridTemplateColumn>
<telerik:DataGridTemplateColumn HeaderText="Shift Name">
<telerik:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate x:DataType="RegisterModel">
<Label Style="{StaticResource GridCellLabelStyle}"
Text="{Binding Shift.Name}"/>
</DataTemplate>
</telerik:DataGridTemplateColumn.CellContentTemplate>
</telerik:DataGridTemplateColumn>
<telerik:DataGridTemplateColumn HeaderText="Start Time">
<telerik:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate x:DataType="RegisterModel">
<Label Style="{StaticResource GridCellLabelStyle}"
Text="{Binding StartTime, Converter={StaticResource ToLocalTimeConverter}, StringFormat='{}{0:t}'}"/>
</DataTemplate>
</telerik:DataGridTemplateColumn.CellContentTemplate>
</telerik:DataGridTemplateColumn>
<telerik:DataGridTemplateColumn HeaderText="End Time">
<telerik:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate x:DataType="RegisterModel">
<Label Style="{StaticResource GridCellLabelStyle}"
Text="{Binding EndTime, Converter={StaticResource ToLocalTimeConverter}, StringFormat='{}{0:t}'}"/>
</DataTemplate>
</telerik:DataGridTemplateColumn.CellContentTemplate>
</telerik:DataGridTemplateColumn>
</telerik:RadDataGrid.Columns>
</telerik:RadDataGrid>
<HorizontalStackLayout Grid.Row="1">
<Button Text="Resume"
IsEnabled="{Binding SelectedRegister, Converter={StaticResource IsNotNullConverter}}"
Command="{Binding ResumeShiftCommand}"/>
<Button Text="Refresh"
Command="{Binding RefreshCommand}"/>
</HorizontalStackLayout>
</Grid>
On initial Refresh, all items are visible in the DataGrid
I navigate forward and then back (PopToRoot), the DataGrid appears empty, although the vertical scroll appears like there are items.
If I tap Refresh, items become visible, but only above the first fold.
If i resize the window vertically, items will appear and disappear depending on the height of the window. (see attached video)
Having this setup:
<telerikDataGrid:DataGridTemplateColumn HeaderText="Age"
CanUserSort="True">
<telerikDataGrid:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate>
<Label Text="{Binding Age}" />
</DataTemplate>
</telerikDataGrid:DataGridTemplateColumn.CellContentTemplate>
<telerikDataGrid:DataGridTemplateColumn.SortDescriptor>
<telerikCommon:PropertySortDescriptor PropertyName="Age" SortOrder="Descending" />
</telerikDataGrid:DataGridTemplateColumn.SortDescriptor>
</telerikDataGrid:DataGridTemplateColumn>
When applying SortDescriptor to the Template column, the column is not initially sorted.
It seems that the default fonts in the RadDataGrid do not support some languages, for example this text "이름" cannot be displayed in Android and WinUI. Rectangles are rendered instead of the correct symbols.
Note that a maui Label can properly display the text.