Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Rotator > Clear all existing items

Not answered Clear all existing items

Feed from this thread
  • Developer Developer avatar

    Posted on Sep 30, 2010 (permalink)

    I'm attempting to clear the items from an existing RadRotator, and replace them with new ones.  Does anyone know if the example below the correct way to do this, or what the best way would be?  Any help would be greatly appreciated.  Thank you!

    // add first image to rotator
    RadImageItem image = new RadImageItem();
    image.Image = Image.FromStream(imageBuffer);
    radRotator1.Items.Add(image);

    // clear existing items so we can add new ones
    radRotator1.Items.Clear();

    // add a differrent image to the rotator
    RadImageItem image2 = new RadImageItem();
    image2.Image = Image.FromStream(imageBuffer2);
    radRotator1.Items.Add(image2);
    radRotator1.Items.

    Reply

  • Peter Peter admin's avatar

    Posted on Oct 5, 2010 (permalink)

    Hello Developer,

    Thanks for the writing.

    Your approach is correct - you can remove an existing item and add a brand new item containing another image.

    It is also possible to change only the image of the existing item, for example:

    image2.Image = Image.FromStream(imageBuffer2);
    ((RadImageItem)radRotator1.Items[0]).Image = image2;

    I hope this will help. Do not hesitate to contact us if you have other questions.

     

    Sincerely yours,
    Peter
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Rotator > Clear all existing items
Related resources for "Clear all existing items"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]