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

Load values to Combo inside Grid

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Anto (DLL Version : 2008.3.1314.35) asked on 29 Oct 2009, 07:59 AM
Hi All

Have a grid with a two RadComboBox in each column.

While the page is Loaded I need to load records from a table (abc) int the first RadComboBox.

I Have used

protected void RadGridCurrInvt_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                GridDataItem item = (GridDataItem)e.Item; 

                RadComboBox

RBCCurrInvtType = (RadComboBox)item.FindControl("RBCCurrInvtType"); 

                RBCCurrInvtType.DataSource = blCllAgt.getCurrentInvestmentType();  
                RBCCurrInvtType.DataBind();  
            }  
        }   
But,Nothing is displayed, only the grid which is shown as  line appears.

Is there any option for this.

Thanking You

-Anto

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Oct 2009, 08:41 AM
Hello Anto,

You have to also set the DataTextField property of your combobox to the corresponding datafield of your database.
c#:
protected void RadGridCurrInvt_ItemDataBound(object sender, GridItemEventArgs e)   
        {   
            if (e.Item is GridDataItem)   
            {   
                GridDataItem item = (GridDataItem)e.Item;  
 
                RadComboBox 
 
RBCCurrInvtType = (RadComboBox)item.FindControl("RBCCurrInvtType");  
                RBCCurrInvtType.DataSource = blCllAgt.getCurrentInvestmentType();   
                RBCCurrInvtType.DataTextField = "DataFieldName"
                RBCCurrInvtType.DataBind();   
                 
            }   
        }  

Thanks
Princy.
Tags
Grid
Asked by
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or