Telerik Forums
UI for .NET MAUI Forum
1 answer
82 views

Hi there,

I am trying to style my dataGrid and I can't seem to use dynamic bindings for background colors etc. Whenever I do I get type mismatch compilation errors. 

If I switch to StaticResources it works just fine.

For app themes I obviously need these values to be dynamic. 

Any idea what I'm doing wrong here? Background styles and binding works correctly throughout the app so the binding is correct. It just doesn't want to compile for this control.

Thanks!

Angus

Didi
Telerik team
 answered on 29 Feb 2024
1 answer
313 views

How to create a reusable styled popup? I want a popup with rounded corners and 2 styled buttons and then inhreit from this BasePopup and get the styling by default, instead of adding this again and again for each popup I create. And then the popup inherting it can add it’s own content and provide commands or actions accordingly for those buttons

in a contentpage you would do it using ControlTemplate and ContentPresenter but I dont see it for the radpopup

Yana
Telerik team
 answered on 26 Feb 2024
1 answer
185 views

Hey Team,

When I tried to use RadComboBox in the RadPopup.
We found the dop down list did not close:
        1. When we leave focus from dropdown or close the RadPopup on windows system
        2. When we leave focus from dropdown on MacOS

<Button
            Clicked="ShowPopup"
            HorizontalOptions="Center"
            Text="Show RadPopup"
            VerticalOptions="Start"
            x:Name="button">
            <telerik:RadPopup.Popup>
                <telerik:RadPopup
                    IsModal="True"
                    OutsideBackgroundColor="#6F000000"
                    x:Name="popup">
                    <telerik:RadBorder BackgroundColor="Wheat" CornerRadius="8">
                        <Grid
                            HeightRequest="200"
                            Padding="10"
                            WidthRequest="200">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="30" />
                                <RowDefinition Height="auto" />
                            </Grid.RowDefinitions>
                            <telerik:RadButton
                                AutomationId="CloseButton"
                                Clicked="ClosePopup"
                                Grid.Row="0"
                                HorizontalOptions="End"
                                Padding="2"
                                Text="Close" />
                            <telerik:RadComboBox AutomationId="staticItemsComboBox" Grid.Row="1">
                                <telerik:RadComboBox.ItemsSource>
                                    <x:Array Type="{x:Type x:String}">
                                        <x:String>USA</x:String>
                                        <x:String>Uganda</x:String>
                                        <x:String>Ukraine</x:String>
                                        <x:String>Canada</x:String>
                                        <x:String>France</x:String>
                                        <x:String>Italy</x:String>
                                        <x:String>United Kingdom</x:String>
                                        <x:String>China</x:String>
                                        <x:String>Japan</x:String>
                                    </x:Array>
                                </telerik:RadComboBox.ItemsSource>
                            </telerik:RadComboBox>
                        </Grid>
                    </telerik:RadBorder>
                </telerik:RadPopup>
            </telerik:RadPopup.Popup>
        </Button>
        private void ClosePopup(object sender, EventArgs e)
        {
            popup.IsOpen = false;
        }
        private void ShowPopup(object sender, EventArgs e)
        {
            popup.IsOpen = true;
        }

 

 

Thanks,

Johnson

Yana
Telerik team
 answered on 22 Feb 2024
1 answer
104 views

Hi all,

I am using AutoComplete as Entry in LoginPage for UserEmail entry; In case the email entered has not been saved in the system, I do not want the [No result message] window to appear. How can I do that?

Xuan.

Didi
Telerik team
 answered on 22 Feb 2024
1 answer
96 views

 

Hi,

seems that the HorizontalTextAlignment="Center" isnt working for the DataGrid ColumnHeader, or at least I am unable to get it working.
For the cells it works.

NuGet Telerik.UI.for.Maui (6.7.0), latest VS2022 with latest Net8/Maui

I am new to Maui/Xaml.

Please help

Uli

Here is my MainPage.xaml and attached a screenshot of the running DataGrid:

 

<?xml version="1.0" encoding="utf-8" ?>

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
             x:Class="MaluTogo.MainPage">

    <ContentPage.Resources>
        <telerik:DataGridColumnHeaderStyle x:Key="ColumnHeaderStyle0" HorizontalTextAlignment="Center"/>
        <telerik:DataGridTextCellStyle x:Key="ColumnCellStyle0" HorizontalTextAlignment="Center"/>
    </ContentPage.Resources>    
    
    <ScrollView>
        <VerticalStackLayout
            Padding="30,0"
            Spacing="25">

            <telerik:RadDataGrid x:Name="_radDataGridMarkets" AutoGenerateColumns="False" UserEditMode="None" UserFilterMode="Disabled" UserGroupMode="Disabled" UserSortMode="None" >
                <telerik:RadDataGrid.Columns>

                    <telerik:DataGridTextColumn PropertyName ="Symbol" HeaderText="symbol" HeaderStyle="{StaticResource ColumnHeaderStyle0}" CellContentStyle="{StaticResource ColumnCellStyle0}" />
                    <telerik:DataGridTextColumn PropertyName ="LocalTimestamp" HeaderText="time" CellContentFormat="{}{0:HH:mm:ss}" HeaderStyle="{StaticResource ColumnHeaderStyle0}"  CellContentStyle="{StaticResource ColumnCellStyle0}" />
                    <telerik:DataGridTextColumn PropertyName ="Bid" HeaderText="bid" HeaderStyle="{StaticResource ColumnHeaderStyle0}" CellContentStyle="{StaticResource ColumnCellStyle0}" />
                    <telerik:DataGridTextColumn PropertyName ="Ask" HeaderText="ask" HeaderStyle="{StaticResource ColumnHeaderStyle0}" CellContentStyle="{StaticResource ColumnCellStyle0}" />
                    <telerik:DataGridTextColumn PropertyName ="Units" HeaderText="units" HeaderStyle="{StaticResource ColumnHeaderStyle0}"  CellContentStyle="{StaticResource ColumnCellStyle0}" />

                </telerik:RadDataGrid.Columns>
            </telerik:RadDataGrid>

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>

 

Yana
Telerik team
 answered on 21 Feb 2024
1 answer
367 views

Hi!

How do I select an item in the listview at runtime (mvvm) and make this item always visible on the screen? Can you help me?

Example:
I press a button to select any item from the list. If this item is not appearing on the screen, listview automatically positions it on the item, making it visible.

Regards,

Rodrigo

Didi
Telerik team
 answered on 20 Feb 2024
1 answer
373 views

What is the proper layout type to use when doing a searchbar?

In IOS, with a page that contains several controls, you would want the listview to appear only when you are typing into the searchbar.

I experimented with Grids, StackLayouts, etc.  Whatever space gets allocated in the layout for the listview is never collapsed when done searching & you hide the listview.   Work fine in Windows and Android.

What is the proper way to do this?

One of many unsuccessful attempts:

 

 <Grid RowDefinitions="Auto,Auto,Auto" Grid.Row="0">
 <Label Text="Employee:" FontSize="Small" WidthRequest="120" Grid.Row="0" />
 <SearchBar x:Name="EmployeeSearch"   Placeholder="Select Employee..." TextChanged="OnTextChangedEmployee" HorizontalOptions="Center" WidthRequest="120"  BackgroundColor="Red" HeightRequest="200" Grid.Row="1" />
 <telerik:RadListView x:Name="searchResultsEmployee"  ItemTapped="OnItemTappedEmployee" Grid.Row="2" BackgroundColor="Green" HeightRequest="200">
                        <telerik:RadListView.ItemTemplate>
         <DataTemplate>
             <telerik:ListViewTemplateCell>
                 <telerik:ListViewTemplateCell.View>
                     <Grid>
                         <Label Margin="10" Text="{Binding EmployeeName}" />
                     </Grid>
                 </telerik:ListViewTemplateCell.View>
             </telerik:ListViewTemplateCell>
         </DataTemplate>
     </telerik:RadListView.ItemTemplate>
 </telerik:RadListView>
 </Grid>
Didi
Telerik team
 answered on 19 Feb 2024
1 answer
100 views

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.

Didi
Telerik team
 answered on 15 Feb 2024
0 answers
65 views
Hello,

I'm using Telelik entry control but, I can't type Korean when I use it. Please check if there's any way to solve it and let me know.
fyi, i'm using Mac OS now.


hyunkyoo
Top achievements
Rank 1
 updated question on 13 Feb 2024
1 answer
139 views

Hi There,

I want to load the DayTemplate according to the month displayed in the current calendar.

The DayTemplate xaml codes: 

 <local:ReminderTemplateSelector.TaskTemplate>
     <DataTemplate>
         <telerik:CalendarBorderLabel Text="{Binding Text}"
                                      TextColor="{StaticResource AccentColor4}"
                                      HorizontalTextAlignment="Center"
                                      VerticalTextAlignment="Center"
                                      FontAttributes="Bold">
             <Label FontFamily="TelerikFontExamples"
                    Text="&#xe80b;"
                    TextColor="{StaticResource AccentColor4}"
                    HorizontalTextAlignment="Center"
                    VerticalTextAlignment="End"
                    Margin="{OnPlatform Default=0, WinUI='0, 0, 0, 4'}" />
         </telerik:CalendarBorderLabel>
     </DataTemplate>
 </local:ReminderTemplateSelector.TaskTemplate>

ReminderTemplateSelector :

public class ReminderTemplateSelector : DataTemplateSelector
{

    public static readonly BindableProperty TasksProperty = BindableProperty.Create(nameof(Tasks), typeof(ReminderTemplateSelector), typeof(ReminderTemplateSelector), null);

    private List<DateTime> tasks;
    public ReminderTemplateSelector()
    {
      
    }

    public DataTemplate TaskTemplate { get; set; }

    public List<DateTime> Tasks
    {
        get => this.tasks;
        set
        {
            this.tasks = value;
        }
    }

    protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
    {
        var node = item as CalendarNode;
        var date = node.Date.Value;
          
        bool hasTaskReminder = false;
        if (this.tasks != null)
        {
            hasTaskReminder = this.tasks.Contains(date);
        }
         

        if (hasTaskReminder)
        {
            return this.TaskTemplate;
        }
         
        return null;
    }
}

I am trying to reload the "Task"  by month on OnDisplayDate event,  but OnSelectTemplate executed before the date change.

It is unable to load the correct DayTemplate based on the current month changes. How should I do it?

        private async void OnDisplayDateChanged(object sender, ValueChangedEventArgs<System.DateTime> e)
        {

            this.ReminderTemplateSelector.Tasks = LoadTask(e.NewValue);
        }


Yana
Telerik team
 answered on 12 Feb 2024
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?