Mujtaba Ali
Top achievements
Rank 1
Mujtaba Ali
asked on 18 Jun 2013, 01:57 AM
Hi
I wanted to add Text box as RadContextMenu item like we do with MS ContextMenuStrip. But I don't see any option for such.
Can you please help me about this?
Regards,
Mujtaba Ali Panjwani
I wanted to add Text box as RadContextMenu item like we do with MS ContextMenuStrip. But I don't see any option for such.
Can you please help me about this?
Regards,
Mujtaba Ali Panjwani
4 Answers, 1 is accepted
0
Accepted
Hi, Mujtaba Ali
Thank you for writing.
You can achieve this by hosting a RadTextBox control in a RadMenuHostItem, as shown below:
Mitko
Telerik
Thank you for writing.
You can achieve this by hosting a RadTextBox control in a RadMenuHostItem, as shown below:
radContextMenu1.Items.Add(new RadMenuHostItem( new RadTextBox()));
Do not hesitate to contact us if you have other questions.
Regards,Mitko
Telerik
RadChart for WinForms is obsolete. Now what?
0
Mujtaba Ali
Top achievements
Rank 1
answered on 18 Jun 2013, 04:01 PM
Hi
Thanks for the reply.
The provided code inserted the text box but the UI is not looking good because the textbox starts from the far left to the far right instead of keeping the icon margins. Would I have to set the margins for RadMenuHostItem?
Regards,
Mujtaba Ali Panjwani
Thanks for the reply.
The provided code inserted the text box but the UI is not looking good because the textbox starts from the far left to the far right instead of keeping the icon margins. Would I have to set the margins for RadMenuHostItem?
Regards,
Mujtaba Ali Panjwani
0
Accepted
Hello Mujitaba,
Thanks for the reply.
Yes you have to set the Margin property of the RadMenuHostItem, you can do it like this:
I hope this helps.
Regards,
Mitko
Telerik
Thanks for the reply.
Yes you have to set the Margin property of the RadMenuHostItem, you can do it like this:
RadMenuHostItem MyContextMenuTextBox = new RadMenuHostItem(new RadTextBox());
MyContextMenuTextBox.Margin = new Padding(20, 0, 10, 0);
radContextMenu1.Items.Add(MyContextMenuTextBox);
I hope this helps.
Regards,
Mitko
Telerik
RadChart for WinForms is obsolete. Now what?
0
Mujtaba Ali
Top achievements
Rank 1
answered on 21 Jun 2013, 07:02 PM
Hi
Alright, thanks.
Regards,
Mujtaba Ali Panjwani
Alright, thanks.
Regards,
Mujtaba Ali Panjwani