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

DetailTable in RadGrid problem

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
fecteaum
Top achievements
Rank 1
fecteaum asked on 18 Sep 2008, 06:40 PM

Hi,

I am using RadGrid with a MasterTableView (Orders table) with a DetailTables (OrderDetails Table). In my OrderDetails  i have 19 fields, just a few of them are visibles in the grid but they are all editables in the EditForm.

I have the customer field and the product field that are GridDropDownColumn. But ia have a problem because i have about 10000 customers and 20000 products.  It take a long time to load the page when I want to modify an item in the OrderDetail. Finaly after the page is load,  i have a warning "Stop the execution of this script? A script on this page slows Internet Explorer.
If it continues, your computer may stop responding.  Yes or No."

Is it possible to load on demand those two GridDropDownColumns or maybe is it possible to enter the 1st, 2 first or 3 first characters of the customer number or the product number before loading the corresponding table?

Or is is possible to use a RadComboBox in a FormTemplate.

Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Sep 2008, 11:08 AM
Hi,

You can set the DropDownControlType for the DropDownColumn to RadComboBox and then access the combobox in the code behind and set its LoadOnDemand property to true as shown below.
aspx:
 <telerik:GridDropDownColumn DataSourceID="SqlDataSource1" DropDownControlType="RadComboBox" UniqueName="Supplier" DataField="SupplierID">                 
 </telerik:GridDropDownColumn> 

cs:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem && e.Item.IsInEditMode) 
        { 
            GridDataItem dat = (GridDataItem)e.Item; 
            RadComboBox rdcbx = (RadComboBox)dat["Supplier"].Controls[0]; 
            rdcbx.EnableLoadOnDemand = true
        } 
   } 

Princy.
Tags
Grid
Asked by
fecteaum
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or