Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
Add/Delete Items
posted

I need to add and delete items from the carousel at run time based on user input.  any samples around?   Also, I need to bring up an edit dialog (custom form) on double click.  Also need to attach a context menu to items.   I've been wading through the excellent infrigistics documentation and haven't found what I need yet.

 

Parents
No Data
Reply
  • 9694
    posted

    The XamCarouselPanel and XamCarouselListBox are both standard WPF controls. As a result, any WPF sample you find which demonstrates how to use a WPF Panel and WPF ListBox can be used with these two controls. If you do a Google search on WPF ListBox or look in any WPF book you will find samples how to add list box items, how to delete items, attach contextual menus and act on routed events.

    To programmatically add or delete items from a ListBox and a XamCarouselListBox control, you call the Add or Insert, and Remove or RemoveAt methods found in the Items property.

    For example, the following C# example adds a Rectangle to a XamCarouselListBox named "carousel":

        carousel.Items.Add(new Rectangle());

    To assign an event handler to a mouse double-click event on the carousel, you can assign the handler to the MouseDoubleClick event on the carousel or on each individual item added to the list box. Visual Studio and Expression Blend both provide shortcuts to make it easy to add events to WPF controls.

    FYI: We offer a WPF Boot Camp and NetAdvantage for WPF public course to empower users to take advantage of WPF features, Expression Blend and Visual Studio functionality to get the most out of NetAdvantage. In the class I demonstrate several of the shortcuts for adding events and how the controls take advantage of WPF.

    To learn more about the public course, check out the following site:

    http://ko.infragistics.com/services/training.aspx#Training

    We'll even come to your office to provide hands-on training. If your company wishes to take advantage of this service, please let us know.

    Thank you,

     

Children