We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to hide GalleryItem dynamically

Thread ID:

Created:

Updated:

Platform:

Replies:

80119 Mar 14,2009 11:42 AM Mar 17,2009 02:47 AM WPF 4
loading
Tags: Tools
shimaz
Asked On March 14, 2009 11:42 AM

How can to hide a single GalleryItem dynamically on form load and show on a button click?


shimaz
Replied On March 15, 2009 01:13 AM

Hope this is the correct way!

foreach (GalleryItem fgg in myMenuGroup.Items)
{
if (fgg.Name == "myGalleryExit")
{
myMenuGroup.Items.Remove(fgg);
myMenuGroup.UpdateLayout();
break;
}
}


Prabhu P [Syncfusion]
Replied On March 16, 2009 06:45 AM

Hi,

Thank you for your interest in Syncfusion products.

The following code will help you to hide the last item from the gallery.

int itemCount = this.galleryGroup.Items.Count;
if( itemCount > 0)
{
(this.galleryGroup.Items[--itemCount] as GalleryItem).Visibility = Visibility.Collapsed;
}

I have also created a simple sample to demonstrate how to add gallery item dynamically on Form load and hide/show item on button click event. Please navigate to the following link and see the sample.

http://files.syncfusion.com/support/Tools.WPF/7.1.0.30/80119/main.htm

Please feel free to contact us if you face any issues. We are very glad to assist you.

Thanks,
Prabu



shimaz
Replied On March 16, 2009 02:42 PM

Thanks for your help.

The following code allows hiding an item at specific location (index).

(this.galleryGroup.Items.GetItemAt(2) as GalleryItem).Visibility = Visibility.Collapsed;




Prabhu P [Syncfusion]
Replied On March 17, 2009 02:47 AM

Hi,

Yes. That code will help us to hide an item at specific location based on the specified index. Hope you got an idea about how to play with Syncfusion Gallery control.

Please let us know if any other concerns.

Thank you for your interest in Syncfusion products.

Regards,
Prabu

>Thanks for your help.

The following code allows hiding an item at specific location (index).

(this.galleryGroup.Items.GetItemAt(2) as GalleryItem).Visibility = Visibility.Collapsed;






CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;