telerikMauiControls:RadEntry in list view value not seen

1 Answer 35 Views
ListView
Daniel
Top achievements
Rank 1
Silver
Bronze
Daniel asked on 28 Apr 2022, 06:25 AM

Hi,

This code in ListViewTemplateCell.View is not seen.

      <telerikMauiControls:RadEntry Grid.Row="0" Grid.Column="1" Text="{Binding Capacity}"  VerticalOptions="Center" IsReadOnly="True" TextColor="{DynamicResource PrimaryColor}"/>
                                  

  <VerticalStackLayout Grid.Row="0"  Margin="10">
            <Label Text="Rules" Margin="10"/>
            <telerikDataControls:RadListView ItemsSource="{Binding RulesSource, Mode=TwoWay}" x:Name="rulesListView" VerticalScrollBarVisibility="Always"
                                   GroupHeaderTemplate="{StaticResource ListViewGroupHeaderTemplate}"
                                   GroupHeaderStyle="{StaticResource ListViewGroupHeaderStyle}"
                                             >
              
                </telerikDataControls:RadListView.ReorderItemStyle>
                <telerikDataControls:RadListView.GroupDescriptors>
                    <telerikListView:PropertyGroupDescriptor PropertyName="Portal" />
                </telerikDataControls:RadListView.GroupDescriptors>
                 <telerikDataControls:RadListView.ItemTemplate>
                    <DataTemplate>
                        <telerikListView:ListViewTemplateCell>
                            <telerikListView:ListViewTemplateCell.View>
                                <telerik:RadBorder  BorderColor="{DynamicResource PrimaryColor}" BorderThickness="1"   VerticalOptions="Center" CornerRadius="5" Margin="5" >
                                    <Grid HeightRequest="200" RowSpacing="10" RowDefinitions="auto, auto, auto, auto, auto" ColumnSpacing="10" ColumnDefinitions="auto, auto, auto, auto" HorizontalOptions="Start" VerticalOptions="Center">
                                        <Label Grid.Row="0" Grid.Column="0" Text="*Capacity (Mega):"  VerticalOptions="Center" FontSize="16" FontAttributes="Bold" Margin="5" HorizontalOptions="Start"/>
                                        <telerikMauiControls:RadEntry Grid.Row="0" Grid.Column="1" Text="{Binding Capacity}"  VerticalOptions="Center" IsReadOnly="True" TextColor="{DynamicResource PrimaryColor}"/>
                                        <Label Grid.Row="0" Grid.Column="2" Text="*Capacity in used (Mega):" VerticalOptions="Center" FontSize="16" FontAttributes="Bold" Margin="5"/>
                                        <Label Grid.Row="0" Grid.Column="3" Text="{Binding CapacityUsed}"  VerticalOptions="Center" />

                                   

                                    </Grid>
                                </telerik:RadBorder>
                            </telerikListView:ListViewTemplateCell.View>
                        </telerikListView:ListViewTemplateCell>
                    </DataTemplate>
                </telerikDataControls:RadListView.ItemTemplate>
                <telerikDataControls:RadListView.LayoutDefinition>
                    <telerikListView:ListViewLinearLayout ItemLength="200" />
                </telerikDataControls:RadListView.LayoutDefinition>
            </telerikDataControls:RadListView>
          
        </VerticalStackLayout>

Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 10 May 2022, 02:10 PM

Is it a bug ?

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 10 May 2022, 07:19 PM

Hi Daniel,

It looks like you are using the RadListView in a StackLayout. This is a known scenario that is not supported with controls that use UI Virtualization.   Please visit the following article and carefully read it to understand why this is a problem and how to avoid it => Controls Are Not Appearing. 

On to your report about using a RadEntry in a ListView...

I am not seeing any problem with using RadEntry in a RadListView ItemTemplate. I've attached a demo, and here is what I see at runtime:

Be sure to double check that your grouping is correct and that all your other XAML is correct (I see missing items in the pasted code). 

PS - There is a known issue with IsReadOnly on Windows in RC2 (it works on other platforms). Someone will reply in your other thread as they investigate further.

 

Debugging Tip

Remember, you always want to isolate the problem away from other unrelated code before blaming it on something. In this case, you can see I am only using the RadEntry in the template. This lets me eliminate other possible causes. You can then continue to add things back in.. until it breaks. Then you will know what might be a problem. even with using all your other elements, I was still not able to replicate the issue.

I've attached my demo. If you can update it to reproduce the issue, and you've eliminated custom business logic causes, please send it back to me for further investigation.

Unrelated - Understanding TwoWay DataBinding

I have noticed you using TwoWay binding mode in many places that it didn't make sense. TwoWay data binding adds a lot of overhead and has a performance cost...so I wanted to explain it here in the hopes that it helps.

In this specific case, why are you using TwoWay binding with the ItemsSource?

I can't think of a situation why you want the RadListView to set your viewmodel's collection (RulesSource) to null when the page opens.

  • OneWay (the default BindingMode) - This means the bound property will set the UI element's value
  • TwoWay - This means the UI element will update the bound property's value

The only time you want TwoWay is when the user interacts with the UI element and you want that interaction to update the bound property's value.

For example, a Checkbox or an Entry the value change in the UI is desired to update the view model. Here's a visual example:

Valid Use

<Checkbox IsChecked="{Binding MyViewModelProperty, Mode=TwoWay}" />

Invalid Use

<ListView ItemsSource="{Binding MyViewModelItems, Mode=TwoWay" />

Regards,
Lance | Manager Technical Support
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Hi Daniel,

Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 11 May 2022, 06:24 AM

Hi,

I added the sample code that simulate my scenario.

The grouping is not working.

Lance | Manager Technical Support
Telerik team
commented on 11 May 2022, 01:34 PM

Thank you for recreating the issue. I am investigating now and will get back to you after I'm done determined what's going on.
Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 11 May 2022, 01:35 PM

-:)
Lance | Manager Technical Support
Telerik team
commented on 11 May 2022, 07:06 PM

I have opened an official Bug Report for this as it's native platform crash that needs the attention of the development team to investigate => ListView crashes app when Grouping with a RadEntry (telerik.com).

It appears to be specific to the presence of an Entry control (not just the RadEntry) and only when grouping. Someone form the MAUI team will follow up in the Bug Report when they've had a chance to debug it and offer further guidance.

Workaround: Change to using a Label.

 


Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 11 May 2022, 07:09 PM

using label.
Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 16 May 2022, 04:20 AM

I checked in Telerik 9, still exist.

The data is not seen.


 <telerikDataControls:RadListView.ItemTemplate>
                    <DataTemplate>
                        <telerikListView:ListViewTemplateCell>
                            <telerikListView:ListViewTemplateCell.View>
                                <telerik:RadBorder  BorderColor="{DynamicResource PrimaryColor}" BorderThickness="1"   VerticalOptions="Center" CornerRadius="5" Margin="5" >
                                    <Grid  RowSpacing="10" RowDefinitions="auto, auto, auto, auto, auto" ColumnSpacing="10" ColumnDefinitions="auto, auto, auto, auto" HorizontalOptions="Start" VerticalOptions="Center">
                                        <Label Grid.Row="0" Grid.Column="0" Text="*Capacity (Mega):"  VerticalOptions="Center" FontSize="16" FontAttributes="Bold" Margin="5" HorizontalOptions="Start"/>
            

Lance | Manager Technical Support
Telerik team
commented on 16 May 2022, 10:08 PM | edited

Hi Daniel, you will get a response here when the team has an update  https://feedback.telerik.com/maui/1564805 regarding the RadEntry and grouping issue.

If you are saying the normal data binding isn't working, I cannot reproduce it. Here's what I see at runtime:

 

FYI - Your code snippet doesn't have the relevant code in it. To be specific, I do not see any 2nd Label or Entry or RadEntry, it just stops after the first Label.

Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 17 May 2022, 08:51 AM

Sorry: stiil not seen the RadEntry


     <telerikDataControls:RadListView.ItemTemplate>
                    <DataTemplate>
                        <telerikListView:ListViewTemplateCell>
                            <telerikListView:ListViewTemplateCell.View>
                                <telerik:RadBorder  BorderColor="{DynamicResource PrimaryColor}" BorderThickness="1"   VerticalOptions="Center" CornerRadius="5" Margin="5" >
                                    <Grid  RowSpacing="10" RowDefinitions="auto, auto, auto, auto, auto" ColumnSpacing="10" ColumnDefinitions="auto, auto, auto, auto" HorizontalOptions="Start" VerticalOptions="Center">
                                        <Label Grid.Row="0" Grid.Column="0" Text="*Capacity (Mega):"  VerticalOptions="Center" FontSize="16" FontAttributes="Bold" Margin="5" HorizontalOptions="Start"/>
                                        <telerikMauiControls:RadEntry Grid.Row="0" Grid.Column="1" Text="{Binding Capacity}"  VerticalOptions="Center" />
       

Lance | Manager Technical Support
Telerik team
commented on 17 May 2022, 12:58 PM

Daniel,

Please try your test with a normal MAUI Entry control. I suspect you're going to experience the same problem.

To verify that I see the same result with either Entry or RadEntry, here's another screenshot

Recommend that you swap out your RadEntry with a Label or Entry and first verify the data binding is working correctly. Once the data binding is working, you can then switch back to use RadEntry. 

Tip- if you're updating the value of that bound property, make sure it is using OnPropertyChanged

Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 17 May 2022, 01:56 PM

With normal MAUI Entry control it works.

I'm not updating the value of that bound property.

So is it bug?

Lance | Manager Technical Support
Telerik team
commented on 17 May 2022, 03:11 PM

It works for me with both Entry and RadEntry, as seen in my previous screenshot and in the attached project.

If you can update my demo project so that it reproduces the problem with only the RadEntry, I will create a bug report for you.

Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 17 May 2022, 03:59 PM

i wii tommorow -:)
Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 18 May 2022, 04:11 AM

The attached demo show what I have in my side ,

Is not running, I don't know why? also when grouping is enable(In comment in xaml side).

 

Lance | Manager Technical Support
Telerik team
commented on 18 May 2022, 01:54 PM

Hi Daniel, you cannot group right now. The development team is already aware of this because you reported it earlier. We are investigating and will reply in your open bug report here => https://feedback.telerik.com/maui/1564805

I do not have a workaround for you at this time, hopefully we'll have a fix in the next release. You will get a notification when the bug report's status changes.

 
Daniel
Top achievements
Rank 1
Silver
Bronze
commented on 18 May 2022, 01:56 PM

OK
Tags
ListView
Asked by
Daniel
Top achievements
Rank 1
Silver
Bronze
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or