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

RadcomboBox and Sqlite

1 Answer 13 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matthew Tan
Top achievements
Rank 1
Matthew Tan asked on 27 Sep 2014, 08:11 PM
Hi

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

Thank you

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 30 Sep 2014, 12:40 PM
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.

 
Tags
General Discussions
Asked by
Matthew Tan
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or