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

RadCombobox Insert and Databind Sample Time

1 Answer 77 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 16 Jul 2012, 05:32 AM


I want insert and databind in radcombobox ,
How i achieve this
RadComboBoxItem Item6 = new RadComboBoxItem(Resources.Ticket.Action_Knowledge_Base);
Item6.Value = "1";
Item6.ImageUrl = "../Content/images/contextmenu/knowledgebase.png";
ddl_Actions.Items.Insert(8, Item6);
 
RadComboBoxItem Item7 = new RadComboBoxItem(Resources.Ticket.Action_CustomAction);
Item7.Value = "9";
Item7.ImageUrl = "../Content/images/contextmenu/caction.png";
ddl_Actions.Items.Insert(9, Item7);
 
RadComboBoxItem Item8 = new RadComboBoxItem(Resources.Ticket.Ticket_RemoveFromFolder);
Item8.Value = "12";
Item8.ImageUrl = "../Content/images/contextmenu/remove-from-folder.png";
ddl_Actions.Items.Insert(10, Item8);
 
RadComboBoxItem Item10 = new RadComboBoxItem(Resources.Ticket.Ticket_Create_Change_Request);
Item10.Value = "10";
Item10.ImageUrl = "../Content/images/contextmenu/changerequest_conf.png";
ddl_Actions.Items.Insert(11, Item10);
 
RadComboBoxItem Item11 = new RadComboBoxItem(Resources.TicketSubscription.Subscribe);
Item11.Value = "11";
Item11.ImageUrl = "../Content/images/contextmenu/subscribe.png";
ddl_Actions.Items.Insert(12, Item11);
 
using (var db = new TBSHelpDeskDataContext(Globals.strCon))
{
    var md = (from a in db.CustomActions select new { a.CustomAction_ID, a.Name }).ToList();
    ddl_Actions.DataSource = md;
    ddl_Actions.DataValueField = "CustomAction_ID";
    ddl_Actions.DataTextField = "Name";
    ddl_Actions.DataBind();
}


Thanks Advance,
Mohamed.

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 16 Jul 2012, 03:03 PM
Hello Mohamed,

You could set the AppendDataBoundItems property of the RadComboBox to True, in order to achieve the desired functionality. You could find our help article about the desired scenario here.

Kind regards,
Nencho
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
mohamed
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or