Date picker in ribbon bar chunk

10 posts, 0 answers
  1. Jim
    Jim avatar
    27 posts
    Member since:
    Jun 2008

    Posted 10 Nov 2009 Link to this post

    Is there a way to put a date picker in a ribbon bar chunk?
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 13 Nov 2009 Link to this post

    Hi Jim,

    This can be done only by code. Here is a code snippet which adds a datetimepicker to a ribbon group:

    RadDateTimePicker picker = new RadDateTimePicker();
                RadHostItem hostItem = new RadHostItem(picker);
                picker.MinimumSize = new Size(150, 20);
                picker.MaximumSize = new Size(150, 20);

                this.radRibbonBarChunk1.Items.Add(hostItem);

    I hope this helps.

    All the best,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jim
    Jim avatar
    27 posts
    Member since:
    Jun 2008

    Posted 13 Nov 2009 Link to this post

    That puts it in the chunk nicely, but now that I have it, how do I position it around other elements in the chunk?
  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 19 Nov 2009 Link to this post

    Hi Jim,

    You can do the following to change the location of the RadDateTimePicker:

    hostItem.Bounds = new Rectangle(20, 30, hostItem.Bounds.Width, hostItem.Bounds.Height);
              
    Please contact me again if you need additional assisntace.

    Sincerely yours,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Jim
    Jim avatar
    27 posts
    Member since:
    Jun 2008

    Posted 19 Nov 2009 Link to this post

    Thanks Boyko,

    That didn't seem to work.  I have included the code I'm using to place the DatePicker,

    Format Code Block(

     

    private void AddDatePicker()

     

    {

     

    RadHostItem hostItem, hostItem1;

     

     

    Label lblStartDate = new Label();

     

    lblStartDate.AutoSize =

    true;

     

    lblStartDate.Text =

    "Start Date";

     

    hostItem =

    new RadHostItem(lblStartDate);

     

     

    //hostItem.Bounds = new Rectangle(0, 30, hostItem.Bounds.Width, hostItem.Bounds.Height);

     

     

    //this.radRibbonBarChunk1.Items.Add(hostItem);

     

     

     

    DateTimePicker startDate = new DateTimePicker();

     

     

    RadDateTimePicker endDate = new RadDateTimePicker();

     

    hostItem1 =

    new RadHostItem(startDate);

     

    startDate.MinimumSize =

    new Size(100, 20);

     

    startDate.MaximumSize =

    new Size(100, 20);

     

    startDate.Format =

    DateTimePickerFormat.Short;

     

     

    endDate.MinimumSize =

    new Size(100, 20);

     

    endDate.MaximumSize =

    new Size(100, 20);

     

    endDate.Format =

    DateTimePickerFormat.Short;

     

    hostItem1.Bounds =

    new Rectangle(new Point(0,5), startDate.MaximumSize);

     

     

    this.radRibbonBarChunk1.Items.Add(hostItem1);

     

    }

    )
  7. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 25 Nov 2009 Link to this post

    Hello Jim,

    Could you please send me a sample project which demonstrates this behavior?
     I have tested the source code and it works fine in my test project. I am enclosing a sample project as an attachment which demonstrates how to change the location of a hostitem in a ribbon group.

    In case, you have any questions, feel free to contact me.

    I hope this helps.


    Greetings,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Jim
    Jim avatar
    27 posts
    Member since:
    Jun 2008

    Posted 26 Nov 2009 Link to this post

    Thanks Bouko,

    I think the problem is one of versions.  Would you please send an example that works with Winforms version 6.1.0.0?

    Kind regards,

    Jim
  9. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 02 Dec 2009 Link to this post

    Hi Jim,

    You are using a version of RadRibbonBar which is almost two years old. To my regret this version is not supported any more. Actually, the Ribbon has undergone a major overhaul since then and it will be best if you upgrade to the newest version. Feel free to contact our sales team for more details.

    Sincerely yours,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. Shabeer
    Shabeer avatar
    3 posts
    Member since:
    Jan 2013

    Posted 23 Jan 2013 Link to this post

    Hi

    I added DateTimePicker in radribbonbar using HostItem, but its culture settings is not happening. I am Setting my datetime culture as dd/mm/yy.

    i am using the below code to do so..


    CultureInfo date_culture=new CultureInfo("en-Us");
    date_culture.DateTimeFormat="dd/mm/yy";

    RadDateTimePicker dtFromDate=new RadDateTimePicker();

    dtFromDate.Culture=date_culture;

    RadHostItem dtFromHostItem=new RadHostItem(dtFromDate);

    radRibbonBarGroup1.items.Add(dtFromHostItem);

  11. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 25 Jan 2013 Link to this post

    Hi Shabeer,

    You should set the Format property to Custom to enable the CustomFormat property and set the latter to "dd/mm/yy".
    You can read more about the control properties in here.

    Off topic, your question does not seems to be related to the initial subject of this thread. You can take a look at our forum usage rules here: http://www.telerik.com/community/forums/winforms/gridview/important-information-on-using-the-telerik-forums.aspx. Please restrain mixing different subjects in future.

    Greetings,
    Peter
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top
UI for WinForms is Visual Studio 2017 Ready