I am displaying the entity data using a radgrid.
on the top of the grid i placed two imagse buttons
1. Show Fitler
2. Hide Filter
By default the filter of the Radgrid should be in hidden state and the hidebtn style property 'display' should be none.
when ever i click on the show filter button.... filter option of radgrid should be enabled and hide btn display property should be updated from 'none' to 'block' and show btn property should be update from 'block' to 'none'
Vice versa if we click on the hide button.
I tried doing this my implementing the below code...
------------------------------------javascript--------------------------------------
function ShowFilter() {
$find(
'<%=rgPluginsList.ClientID %>').get_masterTableView().showFilterItem();
document.getElementById(
'HideBtn').style.display = 'block';
document.getElementById(
'ShowBtn').style.display = 'none';
}
function HideFilter() {
document.getElementById(
'HideBtn').style.display = 'none';
document.getElementById(
'ShowBtn').style.display = 'block';
$find(
'<%=rgPluginsList.ClientID %>').get_masterTableView().hideFilterItem();
}
----------------------------------------------------------------------------------------------------<
asp:ImageButton runat="server" OnClientClick="ShowFilter();" ImageUrl="../Images/ShowFilter.gif"
ID="ShowBtn" />
<asp:ImageButton runat="server" OnClientClick="HideFilter();" ImageUrl="../Images/HideFilter.gif"
ID="HideBtn" />
-----------------------------------------------------------------------------------------------------------
In the Page Load event :
if
(!IsPostBack)
{
HideBtn.Style.Add(
"display", "none");
ShowBtn.Style.Add(
"display", "block");
rgPluginsList.AllowFilteringByColumn = !rgPluginsList.AllowFilteringByColumn;
rgPluginsList.Rebind();
}
-------------------------------------------------------------------------------------------------------------but after the second click of hide btn i am getting the following exception
'
Server Error in '/RadarNetUI' Application.
--------------------------------------------------------------------------------
Multiple controls with the same ID 'FilterTextBox_#' were found. FindControl requires that controls have unique IDs.
Let me know wheter i missed some thing
Thanks in advance
Chaitanya.E
chaitanya.eluru@cosmonetsolutions.com