Hi All,
i lost the filter value when change the pageindex and all the values bind in radgrid.
here i have attached my code:
<telerik:RadGrid ID="radAccountSearch" runat="server" AllowFilteringByColumn="true" ShowGroupPanel="true" GridLines="None"
AllowPaging="true" AllowSorting="true" OnPreRender="radAccountSearch_PreRender"
PageSize="9" DataSourceID="ldSource" Skin="Vista" AllowCustomPaging="true">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView TableLayout="Fixed">
<ItemTemplate>
<%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>
<asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'
runat="server">
<b>ID : </b>
<%# Eval("ID")%>
<b>Name : </b>
<%# Eval("Name")%>
<br />
<b>Company : </b>
<%# Eval("Company")%>
<br />
<b>Mobile : </b>
<%# Eval("Mobile")%>
<b>PhoneNo : </b>
<%# Eval("Phone")%>
<b>Status : </b>
<%# Eval("Status")%><br />
<b>Email Id : </b>
<%# Eval("Email")%>
<br />
<b>City : </b>
<%# Eval("City")%>
<b>State : </b>
<%# Eval("State")%>
<b>Country : </b>
<%# Eval("Country")%><br />
<b>Address: </b>
<%# Eval("Address")%>
<br />
</asp:Panel>
</ItemTemplate>
</MasterTableView>
<GroupingSettings CaseSensitive="false" />
<HeaderStyle Font-Bold="false" />
</telerik:RadGrid>
<asp:LinqDataSource ID="ldSource" runat="server" ContextTypeName="Account.AssetDataContext"
TableName="AccountContacts" OnSelecting="dsContact_Selecting">
</asp:LinqDataSource>
below is my CS file.
protected void radAccountSearch_PreRender(object sender, EventArgs e)
{
int itemCount = (sender as RadGrid).MasterTableView.GetItems(GridItemType.Item).Length + (sender as RadGrid).MasterTableView.GetItems(GridItemType.AlternatingItem).Length;
foreach (GridItem item in (sender as RadGrid).Items)
{
if (item is GridDataItem && item.ItemIndex < itemCount - 1)
{
((item as GridDataItem)["ID"] as TableCell).Controls.Add(new LiteralControl("<table style='display:none;'><tr><td>"));
}
}
}
please i need your help...please help me...
i lost the filter value when change the pageindex and all the values bind in radgrid.
here i have attached my code:
<telerik:RadGrid ID="radAccountSearch" runat="server" AllowFilteringByColumn="true" ShowGroupPanel="true" GridLines="None"
AllowPaging="true" AllowSorting="true" OnPreRender="radAccountSearch_PreRender"
PageSize="9" DataSourceID="ldSource" Skin="Vista" AllowCustomPaging="true">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView TableLayout="Fixed">
<ItemTemplate>
<%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>
<asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'
runat="server">
<b>ID : </b>
<%# Eval("ID")%>
<b>Name : </b>
<%# Eval("Name")%>
<br />
<b>Company : </b>
<%# Eval("Company")%>
<br />
<b>Mobile : </b>
<%# Eval("Mobile")%>
<b>PhoneNo : </b>
<%# Eval("Phone")%>
<b>Status : </b>
<%# Eval("Status")%><br />
<b>Email Id : </b>
<%# Eval("Email")%>
<br />
<b>City : </b>
<%# Eval("City")%>
<b>State : </b>
<%# Eval("State")%>
<b>Country : </b>
<%# Eval("Country")%><br />
<b>Address: </b>
<%# Eval("Address")%>
<br />
</asp:Panel>
</ItemTemplate>
</MasterTableView>
<GroupingSettings CaseSensitive="false" />
<HeaderStyle Font-Bold="false" />
</telerik:RadGrid>
<asp:LinqDataSource ID="ldSource" runat="server" ContextTypeName="Account.AssetDataContext"
TableName="AccountContacts" OnSelecting="dsContact_Selecting">
</asp:LinqDataSource>
below is my CS file.
protected void radAccountSearch_PreRender(object sender, EventArgs e)
{
int itemCount = (sender as RadGrid).MasterTableView.GetItems(GridItemType.Item).Length + (sender as RadGrid).MasterTableView.GetItems(GridItemType.AlternatingItem).Length;
foreach (GridItem item in (sender as RadGrid).Items)
{
if (item is GridDataItem && item.ItemIndex < itemCount - 1)
{
((item as GridDataItem)["ID"] as TableCell).Controls.Add(new LiteralControl("<table style='display:none;'><tr><td>"));
}
}
}
please i need your help...please help me...