Hi, i've a problem with RadGrid filter.
I add columns runtime and all works fine unless i try to filter. When do this i got the exception...Here my code:
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> |
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"> |
<telerik:RadGrid Width="100%" ID="RadGridUtenti" runat="server" AllowFilteringByColumn="true" |
OnSelectedIndexChanged="RadGridUtenti_SelectedIndexChanging" OnNeedDataSource="RadGridUtenti_NeedDataSource"> |
<MasterTableView AllowPaging="true" TableLayout="Fixed" AllowFilteringByColumn="true" DataKeyNames="IdUtente" EditMode="InPlace" /> |
<ClientSettings EnableRowHoverStyle="true" /> |
</telerik:RadGrid> |
</telerik:RadAjaxPanel> |
protected void RadGridUtenti_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
{ |
BindUtenti(); |
} |
private void BindUtenti() |
{ |
RadGridUtenti.Columns.Clear(); |
GridBoundColumn bf = new GridBoundColumn(); |
//bf.DataField = "Username"; |
bf.HeaderText = "Login"; |
bf.ShowFilterIcon = false; |
bf.CurrentFilterFunction = GridKnownFunction.Contains; |
bf.AutoPostBackOnFilter = false; |
bf.FilterDelay = 4000; |
RadGridUtenti.Columns.Add(bf); |
RadGridUtenti.DataSource = gu.GetUtenti(); |
} |
//Where gu.GetUtenti() return a List... |
Any suggestion?