Binding Years and months to slider

10 posts, 0 answers
  1. vijay
    vijay avatar
    46 posts
    Member since:
    Jul 2010

    Posted 29 Jul 2011 Link to this post

    Hi all,

    I have to develop year and months scale. when ever user selects the scale automatically chart should be binds basing on the inputs from the scale.

    Like 2009 Jan, fib, mar, apr, may ,Jun, July, Aug., sept, oct, nov, dec  2010  jan, feb, mar, apr,may,jun,july,aug,sept,oct,nov,dec  2011 jan, feb, mar, apr,may,jun,july,aug,sept,oct,nov,dec  2012.(exactly as shown in the attached file)

    I have tried with RADSLIDER to achieve this functionality but I was not succeed. 

    Can you people please help me in which way I can achieve this? 

    That is very very important to me and very urgent also.


    Thanks in Advance
    -Vijay Kommalapati

  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 29 Jul 2011 Link to this post

    Hi Vijay,

    Could you please tell us exactly what is that you could not accomplish? How I see it, is that you can calculate the Minimum and Maximum values of the slider based on the Ticks of the DateTime (2009 and 2012 years). The TickFrequency can be also calculated and they would be the Ticks for exactly one month.

    For the labels, you can set the TickTemplate and use an IValueConverter, which will convert the Tick values to DateTime objects. You can return the year of the parsed date time, only when the Month is one. This would show only the name of the year ticks and not the months.

    Please let us know if you have questions on this or need assistance.

    Best wishes,
    Alex Fidanov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. vijay
    vijay avatar
    46 posts
    Member since:
    Jul 2010

    Posted 30 Jan 2012 Link to this post

    Alex Fidanov,

    Here i want to design the template like below.

    Major ticks - 2009 to 2012
    minor ticks - jan to dec for evey year.

    (My idea is the slider will apper by defalut with years and when user whants to move on minaor ticks will get the month name should apper) please find the attachment.

    so finally i required the slider with years and months.

    is there any chance to modify the data template like that.

    can you please help me with sample solution in MVVM or Normal way or else please give some idea to procced.

    Please find the attached image exactly i am looking like that only. 

    Thanks
    -Vijay


  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 02 Feb 2012 Link to this post

    Hello Vijay,

    I attached a sample project demonstrating how you can implement your scenario. Give it a try and let us know if it works for you or if we can further assist you.

    Greetings,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. vijay
    vijay avatar
    46 posts
    Member since:
    Jul 2010

    Posted 02 Feb 2012 Link to this post


    Tina Stancheva,

    Thanks for your replay.

    I am trying to open the attached project i am getting the fallowing error.

    C:\Users\admin\Desktop\332526_SilverlightApplication4(1)\SilverlightApplication4\SilverlightApplication4.csproj(104,3): The imported project "C:\Program Files\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

     C:\Users\admin\Desktop\332526_SilverlightApplication4(1)\SilverlightApplication4\SilverlightApplication4.csproj(104,3): The imported project "C:\Program Files\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    Please find the attached screen for reference.

    thanks
    Vijay


  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 02 Feb 2012 Link to this post

    Hi Vijay,

    The project is created for Silverlight 5, this is why you cannot open it. However, I attached the same solution but for Silverlight 4. Let me know if it works for you.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. vijay
    vijay avatar
    46 posts
    Member since:
    Jul 2010

    Posted 07 Feb 2012 Link to this post

    Tina Stancheva,

    thanks for your solution this is what exactly i am expectiong.But i need some little help from you again

    but i tried with selection chnaged even to get the selection start and selection end but i was unable to get those dates.

    I given initially selection start is 2008 and selection end is 2011 but it is not working something like given below

     

    <telerik:RadSlider Margin="20" SelectionEnd="2011" SelectionStart="2008">

    and current build i am getting only selectionstart tik(slide) starts at 2007 like same i need selection end tik(slide).

    Please find the attached screen.

    thanks
    -Vijay
  9. vijay
    vijay avatar
    46 posts
    Member since:
    Jul 2010

    Posted 08 Feb 2012 Link to this post

    still i am waiting for the solution

    this is very much needed to me can you please send it as soon as possible.

    thanks
    -Vijay
  10. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 09 Feb 2012 Link to this post

    Hello Vijay,

    In order to enable the selection range you need to set the RadSlider.IsSelectionRangeEnabled property to True. Then in your solution it would be best to bind the Selection property of the slider. It is of type SelectionRange<double> and it allows you to set the start and end of a selection range.

    Binding the Selection will allow you to control it through a business property which you can dynamically change and set its initial value before or after the application is loaded, depending on your scenario.

    You can also handle the SelectionChanged event to find the current SelectionStart and SelectionEnd values. Please note that in runtime the values of the RadSlider SelectionStart/SelectionEnd and Selection properties are synchronized.

    I modified the sample to demonstrate this approach. Please give it a try and let me know if it works for you.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  11. vijay
    vijay avatar
    46 posts
    Member since:
    Jul 2010

    Posted 13 Feb 2012 Link to this post


    thanks it's working great.

    will start to play with this.

    thanks
    -Veejay kommalapati
Back to Top
DevCraft banner