+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Alternative to Download list

Alternative to Download list

8 posts, 0 answered
  1. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    03 Aug 2010
    Link to this post
    Hi all,

    I need to implement a "download list" type control into one of my pages, however, I have two issues:

    1) The current download list only allows me to select an entire library, whereas I need to allow the user to select multiple individual documents
    2) Again, the current download list doesnt allow me to sort the order the documents are returned in.

    My idea, unless there are any better ones, is to develop a simple control that allows the user to select a single document and provide a title for that document. That way, the user would be able to drag as many of these controls onto the page as they wanted, and re-order them if need be.

    Can anyone tell me how to use the ImageLibraryDialog in my own user control? (or any better ideas if there are already alterntaives)

    Thanks in advance
    higgsy
  2. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    04 Aug 2010
    Link to this post
    Hi,

    Does anyone have any thoughts on my post - im struggling for ideas!?!?!!

    Thanks in advance
    higgsy
  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Aug 2010
    Link to this post
    Hi Al,

    Thank you for contacting Telerik Support.

    Let me first start by mentioning that the current download list has a property SortExpression, which allows you to sort the results based on metafields of the content items. You can refer to attached image for reference. As for the other question you can create control which is similar to the one in this blog post. Then you need to implement a custom WebUITypeEditor which will return a list of content item IDs. Then when your control is loaded on the page you will parse the list of item IDs and get those items from the Images and Documents module using the API. Thus you will be able to build the data source for your download list. These two blog posts contain samples on building WebUITypeEditors:
    http://www.sitefinity.com/blogs/radoslavgeorgiev/posts/10-02-22/roles_selector_and_hiding_control_based_on_user_s_roles.aspx
    http://www.sitefinity.com/blogs/ivandimitrov/ivanposts/09-10-27/creating_a_custom_webuitypeeditor.aspx

    Sincerely yours,
    Radoslav Georgiev
    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
  4. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    04 Aug 2010
    Link to this post
    Hi Radoslav,

    Thanks for your response.

    So I dont end up going too far down the wrong path, can i just clarify what I need to do:

    1) Create a WebUITypeEditor called something like DynamicDocumentSelector which will display all documents in something like the radgrid? I could probably address the sort order by implementing the row drag and drop that is available within the RadGrid component. The WebUITypeEditor will require a template ascx control containing the RadGrid etc?

    2) Created a user control, which has a property marked as e.g [WebEditor("DynamicDocumentSelector, App_Code")]. This will generate a "Select" button, which will open my WebUITypeEditor.

    The Grid shown on, http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx, would serve me perfectly. In the lleft hand grid could be a list of ALL the available documents, and right hand grid could be the documents that the user has selected. Is this all possible through a WebUITypeEditor or do I need to use the Control Designer?

    Thanks again
    Al
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Aug 2010
    Link to this post
    Hi Al,

    The WebUITypeEditor is sufficent - you do not need to create a control designer. The approach you have listed seems very interesting. In the WebUITypeEditor you will need to use a GuidArrayConverter in order to be able to visualize the selected guids in the control editor. You can declare it as I have done in the one second blog post linked.

    Regards,
    Radoslav Georgiev
    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
  6. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    04 Aug 2010
    Link to this post
    Hi,

    Again thanks for your response. Final question(s) then, then I should be good to get going!

    1) Using a WebUITypeEditor, how would i actually lay two grids out side by side as I have suggested? I dont see how I can implement any presentation through the WebUITypeEditor?

    2) I will end up with four files:

     - /App_Code/DynamicDocumentDisplay.cs - this will create a childcontrol (such as a repeater) and will contain a property such as DocumentIDs, marked with my custom WedUIEditorType. This class will be compiled and added to the UserControls toolbox.
     - /App_Code/DynamicDocumentSelector.cs which is my WebUITypeEditor. There will be a template property which will point to the user controls listed below.
     - /Usercontrols/DocumentSelector.ascx - this will literally contain a repeater
     - /UserControls/DocumentSelector.ascx.cs - this will

    Is that right, or have i lost the plot?

    Regards,
    higgsy
  7. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    04 Aug 2010
    Link to this post
    Hi Radoslav,

    I've actually got my first WebUITypeEditor - so thanks for your help and guidance.

    One very quick question.

    In my user control I'm going to display two grids as mentioned. Obviously these grids have a certain amount of code-behind to get them working as I want them too. Do I put this logic in the WebUITypeEditor or in the user control code-behind?

    Thanks again
    higgsy
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Aug 2010
    Link to this post
    Hi Al,

    Thank you for getting back to me.

    Well it is entirely up to you to decide where to put this code. Since the WebUITypeEditor control is going to use the template .ascx file I would create the .ascx file without code file. Then I would put all my code for working with the grids in the editor class. The advantage of this approach is that you will have all the code in one place.

    Kind regards,
    Radoslav Georgiev
    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
Register for webinar
8 posts, 0 answered