hi,
I am using the following code in aspx.cs and aspx page to turn off/on the filetring of radgrid, but its working in reverse. When I click on FilterOn button, filters hide and when I click on FilterOff button, filters show up..it should not work like that
protected void btnFilterOn_Click(object sender, EventArgs e)
{
rdgResult.MasterTableView.TableLayout = GridTableLayout.Auto;
rdgResult.AllowFilteringByColumn = true;
rdgResult.MasterTableView.AllowFilteringByColumn = true;
hdnFilterState.Value =
"ON"
;
this.BindGrid();
ibtnFilterOff.Visible = true;
ibtnFilterOn.Visible = false;
btnFilterOnBtm.Visible = false;
btnFilterOffBtm.Visible = true;
}
protected void btnFilterOff_Click(object sender, EventArgs e)
{
rdgResult.MasterTableView.TableLayout = GridTableLayout.Auto;
rdgResult.AllowFilteringByColumn = false;
rdgResult.MasterTableView.AllowFilteringByColumn = false;
hdnFilterState.Value =
"OFF"
;
this.BindGrid();
ibtnFilterOff.Visible = false;
ibtnFilterOn.Visible = true;
btnFilterOnBtm.Visible = true;
btnFilterOffBtm.Visible = false;
}
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel">
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"rdgResult"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rdgResult"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel"
runat
=
"server"
Transparency
=
"50"
>
<
img
alt
=
"Loading..."
src
=
"Images/Loading.gif"
style
=
"border: 0px; margin-top: 60px;"
/>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadGrid
ID
=
"rdgResult"
runat
=
"server"
Skin
=
"Office2007"
Width
=
"957px"
BackColor
=
"White"
AutoGenerateColumns
=
"true"
PageSize
=
"10"
AllowSorting
=
"True"
AllowPaging
=
"True"
filtercontrolwidth
=
"5px"
AllowFilteringByColumn
=
"false"
showfiltericon
=
"true"
filterlistoptions
=
"VaryByDataType"
showsorticon
=
"true"
EnableViewState
=
"true"
ClientSettings-Scrolling-AllowScroll
=
"true"
OnNeedDataSource
=
"rdgResult_NeedDataSource"
OnItemDataBound
=
"rdgResult_ItemDataBound"
OnColumnCreated
=
"rdgResult_ColumnCreated"
OnItemCreated
=
"rdgResult_ItemCreated"
OnDetailTableDataBind
=
"rdgResult_DetailTableDataBind"
OnExcelMLExportRowCreated
=
"rdgResult_ExcelMLExportRowCreated"
OnExcelMLExportStylesCreated
=
"rdgResult_ExcelMLExportStylesCreated"
OnPreRender
=
"rdgResult_PreRender"
>
<
HeaderStyle
Width
=
"160px"
HorizontalAlign
=
"Center"
CssClass
=
"clsTableHeading1"
/>
<
ItemStyle
Font-Size
=
"8pt"
HorizontalAlign
=
"Left"
CssClass
=
"clsTableCellLeft"
/>
<
ExportSettings
FileName
=
"Detail Report"
IgnorePaging
=
"true"
Excel-Format
=
"ExcelML"
/>
<
ClientSettings
EnableRowHoverStyle
=
"false"
>
<
Selecting
AllowRowSelect
=
"false"
EnableDragToSelectRows
=
"false"
/>
<
Scrolling
AllowScroll
=
"false"
UseStaticHeaders
=
"true"
ScrollHeight
=
"100"
/>
</
ClientSettings
>
<
MasterTableView
TableLayout
=
"Auto"
Name
=
"DetailRpt"
Width
=
"100%"
Height
=
"90%"
AllowMultiColumnSorting
=
"false"
DataKeyNames
=
"Document #"
HierarchyLoadMode
=
"ServerOnDemand"
HeaderStyle-Font-Bold
=
"true"
HeaderStyle-HorizontalAlign
=
"Center"
AllowFilteringByColumn
=
"false"
ItemStyle-HorizontalAlign
=
"Left"
>
<%-- <
HeaderStyle
Width
=
"200px"
/>--%>
<
PagerStyle
AlwaysVisible
=
"true"
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
<
NoRecordsTemplate
>
<
span
class
=
"clsTableCellCenter"
style
=
"padding-left: 250px;"
><
b
>Sorry, there is no
matching data available for display.</
b
></
span
>
</
NoRecordsTemplate
>
<
Columns
>
<
telerik:GridTemplateColumn
HeaderStyle-Width
=
"30px"
HeaderText
=
"Sel"
ShowFilterIcon
=
"false"
DataField
=
"column value"
HeaderStyle-HorizontalAlign
=
"Center"
AllowFiltering
=
"false"
ItemStyle-HorizontalAlign
=
"Center"
>
<
ItemTemplate
>
<
asp:Literal
ID
=
"RadioButtonMarkup"
runat
=
"server"
EnableViewState
=
"true"
></
asp:Literal
>
<
input
type
=
"hidden"
id
=
"hdnDocNo"
name
=
"hdnDocNo"
runat
=
"server"
value='<%# DataBinder.Eval(Container.DataItem,"Document #")%>' />
<
input
type
=
"hidden"
id
=
"hdnRevision"
name
=
"hdnRevision"
runat
=
"server"
value='<%# DataBinder.Eval(Container.DataItem,"Rev Ltr")%>' />
<
input
type
=
"hidden"
id
=
"hdnFlag"
name
=
"hdnFlag"
runat
=
"server"
value='<%# DataBinder.Eval(Container.DataItem,"SHOWHYPERLINK")%>' />
<
input
type
=
"hidden"
id
=
"hdnStatus"
name
=
"hdnStatus"
runat
=
"server"
value='<%# DataBinder.Eval(Container.DataItem,"STATUS")%>' />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Thanks in Advance.