Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ListView > Changing Listview between showing pictures and grid-like view

Not answered Changing Listview between showing pictures and grid-like view

Feed from this thread
  • Tonyz289 avatar

    Posted on Jan 26, 2012 (permalink)

    How do I switch between showing a Listview with pictures to a more grid0like view. It must use JavaScript and/or Ajax not repaint the whole screen.

    Reply

  • Andrey Andrey admin's avatar

    Posted on Jan 31, 2012 (permalink)

    Hello,

    To change the visual representation of the RadListView control you should change its ItemTemplate. Currently RadListView does not support changing the ItemTemplate on the client with JavaScript. You should do this on server side programmatically like described here.

    Another approach is to have two sets of controls and based on some condition you could switch these two sets accordingly. However, this approach could cause layout problems and misalignment of the included elements.

    The easiest approach is to create the structure of the RadListView control programmatically and thus you could fine tune what to be shown. The process of switching the sets could be made by an Ajax call to the server.

    All the best,
    Andrey
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

  • Tonyz289 avatar

    Posted on Jan 31, 2012 (permalink)

    The process of switching the sets could be made by an Ajax call to the server. Do you have an example of this? I am unsure how and switch sets under Ajax.

    Reply

  • Andrey Andrey admin's avatar

    Posted on Jan 31, 2012 (permalink)

    Hi,

    Switching sets of controls is an abstract term. It means that you need to have two different setups of RadListView controls that depends on some input control(button or similar control) state. When the state of the input control is changed you could make a postback to the server, then based on the value of this control you will choose which setup of the control to create and thus you will end up with "different" control.

    More about this approach could be found in the article I have sent you in my previous reply.

    Kind regards,
    Andrey
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ListView > Changing Listview between showing pictures and grid-like view
Related resources for "Changing Listview between showing pictures and grid-like view"

ASP.NET ListView Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]