Hello,
Im having an issue with the RadGrid and allowing Column Filtering. Basicly what has happened is that we had a grid. we had filtering on it and the filtering worked for awhile. we updated our controls to .1314, afterwards filtering started throwing an exception "no property or field 'username' exist in object". from my understanding this was an issue nearly a year ago and hotfix was applied.
to make things worse is that through searching the forums i found out setting the EnableLinqExpressions = false will allow the filtering to happen without throwing an exception, but when i set that property to false, the paging on the grid no longer works. the telerik pager, defaults to page 1, but when you click page 3, the pager is saying page 3 but the grid itself is still displaying records from page 1.
for awhile i believed it to be an ajax problem and i disabled all the ajax on the page and the problem still persist.
so, in a nutshell, if EnableLinqExpression is not set to False, we cannot use the Filtering provided in the control, if we do set EnableLineExpression to False, the pager does not work appropriately.
any help at all would be appreciated.
Im having an issue with the RadGrid and allowing Column Filtering. Basicly what has happened is that we had a grid. we had filtering on it and the filtering worked for awhile. we updated our controls to .1314, afterwards filtering started throwing an exception "no property or field 'username' exist in object". from my understanding this was an issue nearly a year ago and hotfix was applied.
to make things worse is that through searching the forums i found out setting the EnableLinqExpressions = false will allow the filtering to happen without throwing an exception, but when i set that property to false, the paging on the grid no longer works. the telerik pager, defaults to page 1, but when you click page 3, the pager is saying page 3 but the grid itself is still displaying records from page 1.
for awhile i believed it to be an ajax problem and i disabled all the ajax on the page and the problem still persist.
so, in a nutshell, if EnableLinqExpression is not set to False, we cannot use the Filtering provided in the control, if we do set EnableLineExpression to False, the pager does not work appropriately.
any help at all would be appreciated.
public partial class esAdmin_test : System.Web.UI.Page |
{ |
public RadPane gridPane; |
private UserBE.SelectionTypes _selectType = 0; |
//public RadAjaxManager RadAjaxManager1; |
//public RadAjaxLoadingPanel RadAjaxLoadingPanel1; |
public UserBE.SelectionTypes SelectType |
{ |
set { _selectType = value; } |
get { return _selectType; } |
} |
protected void Page_Load(object sender, EventArgs e) |
{ |
RadSplitter mpSplitter = (RadSplitter)Master.FindControl("NestedSplitter"); |
if (mpSplitter != null) |
{ |
ArrayList panes = mpSplitter.GetPanes(); |
RadPane pane = (RadPane)panes[2]; |
gridPane = (RadPane)panes[1]; |
int paneIndex = pane.Index; |
mpSplitter.Items.RemoveAt(paneIndex); |
} |
//RadAjaxManager1 = (RadAjaxManager)Master.FindControl("RadAjaxManager1"); |
//RadAjaxLoadingPanel1 = (RadAjaxLoadingPanel)Master.FindControl("RadAjaxLoadingPanel1"); |
//RadAjaxManager.GetCurrent(this.Page).AjaxSettings.AddAjaxSetting(this.RadAjaxManager1, this.RadGrid1, RadAjaxLoadingPanel1); |
//RadAjaxManager.GetCurrent(this.Page).AjaxSettings.AddAjaxSetting(this.RadGrid1, this.RadGrid1, RadAjaxLoadingPanel1); |
} |
protected void RadGrid1_OnNeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
{ |
SessionManager _session = new SessionManager(); |
ObjectContainerDataSource _datasource = new ObjectContainerDataSource(); |
_datasource.DataObjectTypeName = "Peminic.Business.BusinessEntities.UserBE"; |
_datasource.DataSource = UserBE.GetBySelectionType(UserBE.Context.AreoOfResponsibility, _session.UserID, SelectType); |
RadGrid1.DataSource = _datasource; |
} |
protected void rdoSelectUser_SelectedIndexChanged(object sender, EventArgs e) |
{ |
SelectType = (UserBE.SelectionTypes)Convert.ToInt32(rdoSelectUser.SelectedValue); |
RadGrid1.CurrentPageIndex = 0; |
RadGrid1.Rebind(); |
} |
protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument) |
{ |
//RadGrid1.Rebind(); |
base.RaisePostBackEvent(sourceControl, eventArgument); |
if (sourceControl is RadAjaxManager) |
{ |
if (eventArgument == "Rebind") |
{ |
RadGrid1.MasterTableView.SortExpressions.Clear(); |
RadGrid1.MasterTableView.GroupByExpressions.Clear(); |
RadGrid1.Rebind(); |
} |
if (eventArgument == "ChangePageSize") |
{ |
Session["itemsCount"] = this.RadGrid1.Items.Count; |
//Depending on the paticular scenario this value may vary. |
int rows = (Int32.Parse(this.gridPane.Height.Value.ToString()) - 20) / 32; |
if (rows >= 1) |
{ |
RadGrid1.PageSize = rows; |
// Check whether the CurrentPageIndex is correct. |
if (Session["itemsCount"] != null) |
{ |
int itemsCount = (int)Session["itemsCount"]; |
int pageCount = (int)Math.Ceiling(((double)itemsCount / rows)); |
if (RadGrid1.MasterTableView.CurrentPageIndex > pageCount - 1) |
{ |
RadGrid1.MasterTableView.CurrentPageIndex = pageCount - 1; |
} |
} |
RadGrid1.Rebind(); |
} |
} |
} |
} |
} |
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="ContentPlaceHolderRuleNav"> |
<div class="qsfexHeaderMain">Test Group Filter</div> |
<asp:RadioButtonList ID="rdoSelectUser" runat="server" AutoPostBack="True" |
Font-Names="Verdana" |
style="margin-right: 61px" |
onselectedindexchanged="rdoSelectUser_SelectedIndexChanged"> |
<asp:ListItem Selected="True" Value="0">All</asp:ListItem> |
<asp:ListItem Value="1">Active</asp:ListItem> |
<asp:ListItem Value="2">Disabled</asp:ListItem> |
<asp:ListItem Value="3">Last 3 Months</asp:ListItem> |
<asp:ListItem Value="4">Locked Out</asp:ListItem> |
</asp:RadioButtonList> |
</asp:Content> |
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server"> |
<asp:Panel ID="Panel" runat="server"> |
<telerik:RadGrid ID="RadGrid1" runat="server" PageSize="10" |
AllowPaging="True" GridLines="None" AutoGenerateColumns="False" |
AllowFilteringByColumn="true" EnableLinqExpressions="false" |
OnNeedDataSource="RadGrid1_OnNeedDataSource"> |
<PagerStyle Mode="NextPrevNumericAndAdvanced"> |
</PagerStyle> |
<MasterTableView DataKeyNames="UserID" AllowMultiColumnSorting="True"> |
<GroupByExpressions> |
</GroupByExpressions> |
<Columns> |
<telerik:GridBoundColumn DataField="UserID" Visible="false" SortExpression="UserID"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="LastName" SortExpression="LastName" HeaderText="Last Name"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="FirstName" SortExpression="FirstName" HeaderText="First Name"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Username" SortExpression="Username" HeaderText="User ID"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Email" SortExpression="Email" HeaderText="Email"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Status" SortExpression="Status" HeaderText="Status"> |
</telerik:GridBoundColumn> |
</Columns> |
</MasterTableView> |
<ClientSettings > |
<Selecting AllowRowSelect="True"></Selecting> |
<Scrolling AllowScroll="True"></Scrolling> |
<ClientMessages /> |
</ClientSettings> |
</telerik:RadGrid> |
</asp:Panel> |
</asp:Content> |