Using the DataTable and RadDataGrid example at https://docs.telerik.com/devtools/maui/controls/datagrid/datatable-support
How do I specify the binding for a CellContentTemplate DataTemplate in XAML ?
For example, for IsVisited
<telerik:RadDataGrid.Columns>
<telerik:DataGridBooleanColumn PropertyName="IsVisited" HeaderText="IsVisited" SizeMode="Auto"
CanUserEdit="False" CanUserFilter="false" IsResizable="false">
<telerik:DataGridBooleanColumn.CellContentStyle>
<telerik:DataGridTextCellStyle TextColor="Black" FontSize="14" SelectedTextColor="Blue" HorizontalTextAlignment="End" />
</telerik:DataGridBooleanColumn.CellContentStyle>
<telerik:DataGridColumn.CellContentTemplate>
<DataTemplate>
<telerik:RadCheckBox IsChecked="{Binding IsVisited}" IsEnabled="False" HorizontalOptions="Center"/>
</DataTemplate>
</telerik:DataGridColumn.CellContentTemplate>
</telerik:DataGridBooleanColumn>
</telerik:RadDataGrid.Columns>
I'm getting the message
"Microsoft.Maui.Controls.Xaml.Diagnostics.BindingDiagnostics: Warning: 'IsVisited' property not found on 'System.Data.DataRowView', target property: 'Telerik.Maui.Controls.RadCheckBox.IsChecked'"
The checkbox is not checked when IsVisited is true.
I have the DataGrid SelectionUnit set to Row and SelectionMode set to Multiple.
I'm trying to add a DataGridBooleanColumn that has a check box in the header and for each row. I would like to bind the IsChecked property of the checkbox to if the Row is selected or not.
The check box in the header would either select all or deselect all depending on if it is checked or not. I was able to use the SelectAll and DeselectAll methods which selects all the rows, but it does not check the checkbox at the row level if the row is selected.
Is there a way to do this?
Can we link/associate a Label to a CheckBox to handle toggling the checkbox?
It would be useful to do this using MAUI standard label or providing a Text property to show next to the Checkbox?
Am I missing something? If this is not possible, its seems like a good feature?
eg:
<telerik:RadDataGrid x:Name="dataGrid"
ItemsSource="{Binding People}">
<telerik:RadDataGrid.GroupHeaderTemplate>
<telerik:RadTreeView x:Name="treeView"
ItemsSource="{Binding Items}"
CheckBoxMode="Recursive">
<telerik:TreeViewDescriptor DisplayMemberPath="Name"
ItemsSourcePath="Children"
TargetType="{x:Type local:Item}" />
<telerik:RadTreeView.BindingContext>
<local:ViewModel/>
</telerik:RadTreeView.BindingContext>
</telerik:RadTreeView>
</telerik:RadDataGrid.GroupHeaderTemplate>
</telerik:RadDataGrid>
public class Item
{
public Item(string name)
{
this.Name = name;
this.Children = new ObservableCollection<Item>();
}
public string Name { get; set; }
public IList<Item> Children { get; set; }
}
public class Person
As the title suggests, how do I set colors for RadCheckBox when IsEnabled = false?
At the moment, this is a WinUI question only.
Thanks,
-ldl-
Hi,
I created a project and referenced the following libraries:
I have imported namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
and created a RadCheckBox like so:
<telerik:RadCheckBox x:Name="rcb" VerticalOptions="Center" />
When I run the application I get the following error:
Is there anything I am missing?
Hi,
Running the ControlSamples demo app, if you add a CheckChanged event handler to the RadCheckBox , the event
handler code is not hit. If the RadCheckBox is changed to the default MAUI checkbox it works. We are seeing this on
NET 7 Mac OS 12.5.1
Thanks
I have been building a test app to see if the controls and UI layout we need can work using Telerik .net maui.
I have seen many documents about the RadDataGrid and others about the RadCheckBox BUT, I have not seen any examples that show how to turn one of the returned data columns into a checkbox.
I have tried 2 methods for creating the RadDataGrid;
1) Building the headers individually (this did not produce data rows after fetching)
2) simply creating the RadDataGrid and assigning its ItemSource (this created the columns and produced data rows after fetching)
I am using an ObservableCollection to house all my row(s) data which is what I tie the RadDataGrid ItemSource to using the .Add function
When I did try the 1st method, I could not bind to the properties of each item in the ObservableCollection which may be either a code issue or a brain (me) issue, not sure because I tried to follow the examples Telerik has put out.
I saw a note that if you set the RadDataGrid AutoGenerateColumns value to "True" then Telerik will build the columns according to the underlying data type (ie. if one of the columns shows bool data, it will turn that into a checkbox)....Correct me if I am wrong on that one
I could not get that option to work either, just displayed "True" or "False" in the UI.
I am currently not using the MVVM pattern... All work is done in Code-Behind for simplicity...
Can anyone show me how this can be accomplished or if it cannot be? Also, is there any better documentation than what is found here ( https://docs.telerik.com/devtools/maui/controls/datagrid/overview )
If I can ask one follow up...is there a feature for drag and drop?
The RadCheckBox CheckedSymbolColor doesn't reflect the value I've chosen (testing WinUI at the moment).
Any advice?