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

Populate radcombobox in filter template in radgrid

1 Answer 402 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rich Helferty
Top achievements
Rank 1
Rich Helferty asked on 23 Nov 2010, 07:22 PM
What event can I use to populate a radcombobox in filter template in a radgrid from server side code. I do not have the ability to use datasource referenced on the page.  Can I do in it in the radgrid OnColumnCreated or ondatabound events?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Nov 2010, 06:04 AM
Hello Rich,

You can populate the RadComboBox in FilterTemplate by accessing it in ItemDataBound event like below.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridFilteringItem)
       {
           GridFilteringItem filterItem = (GridFilteringItem)e.Item;
           RadComboBox combo = (RadComboBox)filterItem.FindControl("RadComboBox1");// accessing RadComboBox in FilterTemplate
           // Set DataSource of combo
           //combo.Items.Add(new RadComboBoxItem("New"));
       }
   }

Thanks,
Princy.
Tags
Grid
Asked by
Rich Helferty
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or