Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:49:43+00:00 2026-05-22T21:49:43+00:00

I have a webpage that has a Telerik RadComboBox in radgrid control on the

  • 0

I have a webpage that has a Telerik RadComboBox in radgrid control on the page,and i have a SqlserverCe database.My issue is how can i write the code to bind the RadCombobox at page load event in asp.net please help me…..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:49:44+00:00Added an answer on May 22, 2026 at 9:49 pm

    Items are bound to RadComboBox basically in the same way as to an ASP.NET DropDownList.

    You can bind the RadComboBox to ASP.NET 2.0 datasources, ADO.NET DataSet/DataTable/DataView, to Arrays and ArrayLists, or to an IEnumerable of objects. And of course you can add the items one by one yourself. With RadComboBox, you’ll use RadComboBoxItems instead of ListItems.

    In one way or other, you’ll have to tell the combobox what is each item’s text and value.

    Working with Items in Server Side Code:

    protected void Page_Load(object sender, EventArgs e)
    {  
        if (!Page.IsPostBack)  
        {    
            RadComboBoxItem item1 = new RadComboBoxItem();    
            item1.Text = "Item1";   
            item1.Value = "1";    
            RadComboBox1.Items.Add(item1);    
            RadComboBoxItem item2 = new RadComboBoxItem();   
            item2.Text = "Item2";    
            item2.Value = "2";   
            RadComboBox1.Items.Add(item2);    
            RadComboBoxItem item3 = new RadComboBoxItem();    
            item3.Text = "Item3";   
            item3.Value = "3";   
            RadComboBox1.Items.Add(item3);  
        }
    }
    

    Binding to DataTable, DataSet, or DataView:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            SqlConnection con = new SqlConnection("Data Source=LOCAL;Initial Catalog=Combo;Integrated Security=True");
    
            SqlDataAdapter adapter = new SqlDataAdapter("SELECT [Text], [Value] FROM [Links]", con);
            DataTable links = new DataTable();
    
            adapter.Fill(links);
    
            combo.DataTextField = "Text";
            combo.DataValueField = "Value";
            combo.DataSource = links;
            combo.DataBind();
        }
    }
    

    EDIT: RadComboBox in a Grid:

    Inside a RadGrid, it is perhaps easiest to use load on demand, by setting EnableLoadOnDemand=”True” and handling the OnItemsRequested event.

    protected void RadComboBox1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
            {
                string sql = "SELECT [SupplierID], [CompanyName], [ContactName], [City] FROM [Suppliers] WHERE CompanyName LIKE @CompanyName + '%'";
                SqlDataAdapter adapter = new SqlDataAdapter(sql,
                    ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
                adapter.SelectCommand.Parameters.AddWithValue("@CompanyName", e.Text);
    
                DataTable dt = new DataTable();
                adapter.Fill(dt);
    
                RadComboBox comboBox = (RadComboBox)sender;
                // Clear the default Item that has been re-created from ViewState at this point.
                comboBox.Items.Clear();
    
                foreach (DataRow row in dt.Rows)
                {
                    RadComboBoxItem item = new RadComboBoxItem();
                    item.Text = row["CompanyName"].ToString();
                    item.Value = row["SupplierID"].ToString();
                    item.Attributes.Add("ContactName", row["ContactName"].ToString());
    
                    comboBox.Items.Add(item);
    
                    item.DataBind();
                }
            } 
    

    You can also bind the combobox manually in the grid’s OnItemDataBoundHandler event:

    protected void OnItemDataBoundHandler(object sender, GridItemEventArgs e)
            {
                if (e.Item.IsInEditMode)
                {
                    GridEditableItem item = (GridEditableItem)e.Item;
    
                    if (!(e.Item is IGridInsertItem))
                    {
                        RadComboBox combo = (RadComboBox)item.FindControl("RadComboBox1");
    
                        // create and add items here
                        RadComboBoxItem item = new RadComboBoxItem("text","value");
                        combo.Items.Add(item);
    
                    }
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webpage that has a Telerik RadComboBox on the page. One of
I have a simple jQuery code that runs on a web page that has
I have a webpage that has a comment box that can be toggled by
I have a webpage that has 3 file inputs. There are specific fields on
I will create a webpage that has a sidebar, and the sidebar will have
I have a webpage built with a dropdown that has a list of books.
I have a Google Map on the webpage with markers on it that has
I have created a web page that has two bars across the top of
I have a ASP.NET web page that contains many textboxes. Each textbox has a
I have a webpage that has a textbox. When the user enters information into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.