This is a migrated thread and some comments may be shown as answers.

ContextMenu

19 Answers 195 Views
ListView
This is a migrated thread and some comments may be shown as answers.
N Mackay
Top achievements
Rank 1
N Mackay asked on 20 Nov 2015, 10:36 AM

Hi, 

Does RadListView support ContextMenu and if so do you have any XAML samples?

I tried adding one like you would in the vanilla Listview but nothing happened (compiled and ran okay), ideally you'd want to activate it on long press. No a big problem if it's not supported but I'd like to clarify it.

Thanks,

Norman.

 

19 Answers, 1 is accepted

Sort by
0
Accepted
Rosy Topchiyska
Telerik team
answered on 24 Nov 2015, 06:41 PM
Hello Norman,

Thank you for writing.

The list view does not support context menu out of the box, but if you are ok to use DisplayActionSheet instead, this could be achieved, although some customizations are required. I have attached a sample project that demonstrates how this could be done. Please, note that on iOS the long press event is not triggered if the selection gesture is tap, so at the moment it is not possible to use both selection with tap and display the context menu with hold gesture. Please, take a look at the sample and let us know if this could work for you.

I look forward to your reply. 

Regards,
Rosy Topchiyska
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
N Mackay
Top achievements
Rank 1
answered on 25 Nov 2015, 05:52 PM

Hi Rosy,

Thanks for preparing that sample, it's very useful.

I think for now we'll just do without it it, it would be nice maybe in a future release if it was supported with LongPress on all supported platforms but it's not worth doing at the moment as ActionSheet (like a lot of things in Forms) is a pain to style on Android.

If you have somewhere to add suggestions then I'll add it as a nice to have.

Thanks again,

Norman.

 

0
Rosy Topchiyska
Telerik team
answered on 30 Nov 2015, 02:53 PM
Hello Norman,

You can use our ideas and feedback portal to log suggestions.

Regards,
Rosy Topchiyska
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alen
Top achievements
Rank 1
answered on 27 May 2019, 11:51 PM
Is it possiable to style the DisplaySheet?
0
Yana
Telerik team
answered on 28 May 2019, 03:28 PM
Hello Alen,

There are some resources on the Internet about styling DisplayActionSheet, still, I didn't manage to find a complete solution. You could check the following threads, for an example:
https://forums.xamarin.com/discussion/29168/displayalert-and-displayactionsheet-styling
https://forums.xamarin.com/discussion/26252/customrenderer-or-styling-of-displayactionsheet

As an alternative, I suggest you check our RadPopup control - it could be used as a context menu as well. As an example, you can check our QSF application - just go to Popup/Context Menu example.  I've attached a screenshot to show you how it looks.

Let me know if toy have any additional questions on this.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alen
Top achievements
Rank 1
answered on 28 May 2019, 08:29 PM
thx will check them out.
0
Mehdi
Top achievements
Rank 1
Veteran
answered on 02 Dec 2020, 01:26 PM
based on my previous experiences about your products years ago, this was me that suggested my manager to buy and use your products, and now I am disappointed for that decision because clearly your produced components are designed so bad. For example, your RadListView, in spite of using Xamarin.Forms.Cell-inherited cells, doesn't support MenuItems! Why? Haven't your components been written in an object-oriented language? Are you using Fortran for example?

You know what? When a software developer or engineer recommends your products to their company, their normal expectation from such a famous company like you is that your components have been designed and implemented object oriented, so that for example, if your component inherits from the basic ListView or Cell, they expect that it DOES support ALL its base class's functionalities. However, what I observe now is that, for example, your RadListView doesn't support MenuItems and ContextOptions, while its base class does! Have you asked yourselves if someone like me doesn't like to implement the context menu item functionality using your SWIPPING approach? Now I have to change the RadListView wherever it's used?!
0
Lance | Manager Technical Support
Telerik team
answered on 02 Dec 2020, 06:22 PM

Hi Mehdi,

Thank you for the feedback, I have passed it on to the team.

Adding a Context Menu

You are not forced to use swiping to give the user contextual actions.  You can use any popup option you prefer and iterate over the Cell's ContextActions to visualize them, but that is up to you.

For the easiest and fastest option, I recommend that you avoid that complexity and just use a RadPopup in the ItemTemplate. 

Further Assistance

You have opened a Bug Report to get support for a Calendar problem rather than opening a Support Ticket or forum post. A Bug Report is not a substitute for Technical Support (the problem you have reported is not a bug).

I see that the account you're using right now does not have a license for UI for Xamarin. I'm guessing that the company purchased the license? This is an easy fix, please give the license owner the attached tutorial on how to assign you the license so that you can get the support.

Once they assign it to you, you will be able to open 1:1 support cases to directly assist you with any problems you're having. 

Note: We do monitor the forums, but a prompt response is not guaranteed. It can take several days depending on factors such as Support Tickets ahead of you and available resources.

Code of Conduct

Before I close this, I wanted to comment on your conduct of copy-pasting the same message in multiple locations.  Doing this, particularly when using combative language, can be misinterpreted as abusive or categorized as spam.

Trust that we will see your feedback, regardless of where you choose to initially post it. If necessary, we will create a new Feature Request if one does not exist.  We take all feedback seriously, multiple posts of the same feedback do not increase the seriousness or priority.

Thank you for your understanding in this matter.

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Mehdi
Top achievements
Rank 1
Veteran
answered on 02 Dec 2020, 11:38 PM

Hi Lance, 

Thanks a lot for the response. Regarding the calendar, actually I think it is a bug because setting the AppointmentSource is running well on Android but throws exception on UWP. Btw, I'll do what you said.

0
Lance | Manager Technical Support
Telerik team
answered on 02 Dec 2020, 11:48 PM

Hi Mehdi,

Regarding the Calendar problem, I was able to replicate the issue you were having. 

I do believe it is the same issue that is mentioned in the Bug Report you linked to, where the Calendar hasn't loaded on the native platform yet.

I think the original workaround did not work for you because there was not a long enough delay in the task (to add ~100ms of delay to give UWP a chance to load the RadCalendar object.

In any case, I gave you a more reliable solution in my reply in the Bug Report thread by using NativeControlLoaded event. If that still doesn't work for you, please update the demo I sent and attach it back to that thread.

Thank you for your patience!

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Mehdi
Top achievements
Rank 1
Veteran
answered on 03 Dec 2020, 09:24 AM

Hi Lance,

Thanks a lot.

0
Mehdi
Top achievements
Rank 1
Veteran
answered on 05 Dec 2020, 01:07 AM

Hi Lance,

As a replace for swiping approach, I was going to use your introduced Popup-based approach for simulating context menu for RadListView. There you use ListViewTemplateCell template, which consists of a Label and BoxView but the problem is that I'm using ListViewTemplateCell template for showing my results to be able to show both title and detail description for each record. 

I hope you have some idea for solving this.

0
Lance | Manager Technical Support
Telerik team
answered on 07 Dec 2020, 02:56 PM

Hello Medhi,

I'm sorry, I don't understand your question. You explain:

"There you use ListViewTemplateCell template, which consists of a Label and BoxView but the problem is that I'm using ListViewTemplateCell template for showing my results"

A ListViewTemplateCell is a ListViewTemplateCell, it doesn't matter what you have for contents. Just change the BoxView and Label in my example with the Labels you are using in your code.

For example:

<StackLayout>
    <Label Text="{Binding Title}"/>
    <Label Text="{Binding Description}"/>
</StackLayout>

> The takeaway from that tutorial is the RadPopup and the ellipsis button, not the BoxView or Labels.

TextCell

Did you mean to say that you are using the ListViewTextCell? If yes, then you must to switch to TemplateCell so that you can add a RadPopup to the template. TextCell is only meant for simple situations, you require a more advanced scenario.

Support

If you would like 1 on 1 guidance, please open a Support Ticket here (important: please have your license problem resolved before you can open the ticket, your trial expired 6 months ago).

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Mikael Evander
Top achievements
Rank 2
answered on 07 Dec 2020, 04:47 PM

Hi Lance,

Thanks a lot for the response. First of all, that free trial license was for such a ling time ago but currently I am working in a company that have purchased your full product license, and if you refer to my account you'll see that I have been added to its managers' list. Second, regarding my previous post, I'm sorry for the mistake, I meant "I'm using ListViewTextCell template to be able to show both title and detail description for each record."

0
Mehdi
Top achievements
Rank 1
Veteran
answered on 07 Dec 2020, 05:09 PM

Hi Lance,

When I sent the previous post I hadn't noticed in which account I was logged-in but thanks a lot for the response. First of all, that free trial license was for such a ling time ago but currently I am working in a company that have purchased your full product license, and if you refer to my account you'll see that I have been added to its managers' list. Second, regarding my previous post, I'm sorry for the mistake, I meant "I'm using ListViewTextCell template to be able to show both title and detail description for each record."

Many thanks

0
Lance | Manager Technical Support
Telerik team
answered on 07 Dec 2020, 05:10 PM

Hi Mikael/Medhi,

To clear things up and to help you get the fastest support in the future, which one of these scenario's is correct?

  1. You are Mehdi... using Mikael's account
  2. You are Mikael... using Mehdi's account

If it is #1, then please ask Mikael to assign the developer license to you (not the Manager seat). Important: Mikael needs to unassign himself first, then the dev seat will be open to assign you. (Mikael will always remain the owner of the license, even after setting you as the dev)

If it is #2, then just keep using your own account, it has a Priority support DevCraft license.

 

Okay, onto your technical question. Yes, you need to switch from TextCell to TemplateCell.  Just go ahead and use the tutorial, but use Two Labels instead of a Label and a BoxView.

Here's an example:

Old

<ListViewTemplateCell Text="{Binding Title}"  Detail="{Binding Description}"/>

New

<telerikListView:ListViewTemplateCell>
    <Grid x:Name="ItemGrid"
          BackgroundColor="{StaticResource BackgroundColor}"
          HeightRequest="70">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="45" />
        </Grid.ColumnDefinitions>

        <StackLayout  HorizontalOptions="Center" VerticalOptions="Center">
            <Label Text="{Binding Title}" FontSize="18"/>
            <Label Text="{Binding Description}"/>
        </StackLayout>

        <!-- FOLLOW THE REST OF THE TUTORIAL TO FINISH THIS  -->
        ...
    </Grid>
</telerikListView:ListViewTemplateCell>

You can use just about anything you want inside a TemplateCell, that is the whole purpose and advantage to choosing that cell type :)

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Mehdi
Top achievements
Rank 1
Veteran
answered on 07 Dec 2020, 05:23 PM
Hi Lance,
Thank you. Now the licensed users' lists are updated.
0
Mehdi
Top achievements
Rank 1
Veteran
answered on 12 Dec 2020, 12:04 AM

Dear Lance,

Hi again, and thank you for the update. Actually, I think the ListItemDisplayLabel should be replaced by that 2-label StackLayout. By the way, although I'm not using MVVM, and I create my ItemTemplates dynamically and programmatically, so I have to change the XAML to C#, but this is not my problem. What I can't understand about the tutorial is that there, 2 columns have been defined for the ItemGrid, but 3 elements (ListItemDisplayLabel, ItemSpacerBoxView and a button) are added to it. Generally, I don't get the usage of ItemSpacerBoxView.

Would you provide an explanation for that please?

0
Lance | Manager Technical Support
Telerik team
answered on 14 Dec 2020, 03:43 PM

Hello Mehdi,

You are not restricted to only what we shared in the tutorial. The relevant exercise in the tutorial is the RadPopup and the button to open the popup. everything else is a design choice. Just use your setup.

  • The BoxView is irrelevant, it only a design choice for an example. You do not need ot use them
  • The Labels are irrelevant, they are just to show the example's text, you do not need to use them
  • The RadPopup and Button are irrelevant. This is the takeaway of the tutorial.

So that I am extra clear, you do not need to use everything in that example to get a RadPopup... start fresh and use whatever you want inside the TemplateCell's view, it is 100% up to you and your design/developer's choices.

Once you have a final design, then add the RadPopup approach explained in the tutorial.

MVVM

Regarding your comment on using MVVM, that is also irrelevant. Even though MVM uses Data Binding... it does not mean every Data Binding implementation is MVVM.

It doesn't matter how you're setting the ListView's ItemsSource or whether not you use XAML or C#. The bottom line is if you are using a DataTemplate with a BindingContext, you are also using Data Binding in order to bind values from the BindingContext

TIP - The only difference between XAML and C# is one uses SetBinding extension method (C#) while the other uses a Binding Markup Extension (XAML). when you see "InitializeComponent()" in a XAML page, that is when the XAML defined objects are actually loaded.

Further Assistance

If you have any further question, please open a Support Ticket instead of posting another reply to this thread. We've branched away from Norm's initial question and further conversation adds confusion to the initial context.

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ListView
Asked by
N Mackay
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
N Mackay
Top achievements
Rank 1
Alen
Top achievements
Rank 1
Yana
Telerik team
Mehdi
Top achievements
Rank 1
Veteran
Lance | Manager Technical Support
Telerik team
Mikael Evander
Top achievements
Rank 2
Share this question
or