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

[Solved] Load on Demand not working after page load

1 Answer 111 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Bruce St.Clair
Top achievements
Rank 2
Bruce St.Clair asked on 15 Apr 2008, 01:52 PM
What I am trying to do it preload the combo box with a single value on page load, which comes from the current record.  Then if the end user wants to change that value then load all the possible values into the combo box.  IF I dont prefill on page load the loadondemand works just fine.  But I am trying to get the data set I pass to the client as small as possible.  I have 20 combo boxes on 1 page with up to 4000 records I could pass with the end user never changing any of them, hence the load on demand.  Thanks for any help.

protected void Page_Load(object sender, EventArgs e)

{

//get values from database

DataAccess.

DA dta = new DA("connection strign stuff");

DB.m_da = dta;
//fill dataset

DataSet ds = new DataSet();

try

{

dta.SetRead(

"select [ID],[RptName] from ReportInfo where ID = 1", 1);

dta.Run(

ref ds);

RadComboBox1.Items.Add(
new RadComboBoxItem(ds.Tables[0].Rows[0].ItemArray.GetValue(1).ToString()));

}

catch (Exception ex)

{

string s = ex.Message;

}

}

protected void RadComboBox1_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)

{

DataAccess.

DA dta = new DA("connection string stuff");

DB.m_da = dta;

DataSet ds = new DataSet();

try

{

dta.SetRead(

"select [ID],[RptName] from ReportInfo", 1);

dta.Run(

ref ds);

RadComboBox1.DataSource = ds;

RadComboBox1.DataValueField =

"ID";

RadComboBox1.DataTextField =

"RptName";

RadComboBox1.DataBind();

}

catch (Exception ex)

{

string s = ex.Message;

}

}

1 Answer, 1 is accepted

Sort by
0
Bruce St.Clair
Top achievements
Rank 2
answered on 17 Apr 2008, 01:27 PM
I found the answer

http://www.telerik.com/community/forums/thread/b311D-bcaacc.aspx

Also could a admin move this topic to combo for ajax area please.
Tags
ComboBox
Asked by
Bruce St.Clair
Top achievements
Rank 2
Answers by
Bruce St.Clair
Top achievements
Rank 2
Share this question
or