This is a migrated thread and some comments may be shown as answers.

Date picker in ribbon bar chunk

9 Answers 175 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 10 Nov 2009, 07:29 PM
Is there a way to put a date picker in a ribbon bar chunk?

9 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 13 Nov 2009, 05:09 PM
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.
0
Jim
Top achievements
Rank 1
answered on 13 Nov 2009, 09:27 PM
That puts it in the chunk nicely, but now that I have it, how do I position it around other elements in the chunk?
0
Boyko Markov
Telerik team
answered on 19 Nov 2009, 12:28 PM
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.
0
Jim
Top achievements
Rank 1
answered on 19 Nov 2009, 06:24 PM
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);

 

}

)
0
Boyko Markov
Telerik team
answered on 25 Nov 2009, 07:39 AM
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.
0
Jim
Top achievements
Rank 1
answered on 26 Nov 2009, 04:06 PM
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
0
Martin Vasilev
Telerik team
answered on 02 Dec 2009, 08:01 AM
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.
0
Shabeer
Top achievements
Rank 1
answered on 23 Jan 2013, 11:14 AM
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);

0
Peter
Telerik team
answered on 25 Jan 2013, 02:14 PM
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.
Tags
RibbonBar
Asked by
Jim
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Jim
Top achievements
Rank 1
Martin Vasilev
Telerik team
Shabeer
Top achievements
Rank 1
Peter
Telerik team
Share this question
or