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

filtertemplate

1 Answer 57 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 09 Dec 2011, 02:47 AM
?How to create filter template in radgrud dynamically

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Dec 2011, 04:21 AM
Hello Tina,

Try the following code.
C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if (e.Item is GridFilteringItem)
 {
   GridFilteringItem item = (GridFilteringItem)e.Item;
   TableCell cell = (TableCell)item["Country"];
   RadComboBox combo = new RadComboBox();
   combo.DataTextField = "Name";
   combo.DataValueField = "Name";
   combo.DataSourceID = "SqlDataSource1";
   cell.Controls.Add(combo);
 }
}

-Shinu.
Tags
Filter
Asked by
Tina
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or