9 Answers, 1 is accepted
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.
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.
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);
}
)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.
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
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.
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);
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