RadcomboBox and Sqlite

2 posts, 0 answers
  1. Matthew Tan
    Matthew Tan avatar
    3 posts
    Member since:
    Sep 2005

    Posted 27 Sep 2014 Link to this post

    Hi

    Are these combination compatible with Radcombo and SQLite ? Any sample scripts ?

    Thank you
  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 30 Sep 2014 Link to this post

    Hi Matthew,

    RadComboBox can be bound to any datasource if you pass the correct data.

    I suppose that you are using some of the free sqlite libraries to make the connection between your app and the sqlite db file. You can create list of RadComboBoxItem-s and put db-data inside this list:

    <telerik:RadComboBox runat="server" ID="RadComboBox1"></telerik:RadComboBox>

    protected void Page_Load(object sender, EventArgs e)
    {
        RadComboBox1.DataSource = LoadDataFromSQLite();           
        RadComboBox1.DataBind();
    }
     
    protected List<RadComboBoxItem> LoadDataFromSQLite()
    {
        List<RadComboBoxItem> items = new List<RadComboBoxItem>();
     
        //POPULATE WITH THE DATA FROM THE SQLite
        for (int i = 0; i < 10; i++)
        {
            items.Add(new RadComboBoxItem("Item ", i.ToString()));               
        }
     
        return items;
    }

    I hope this helps.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top