Hi,
I have radgrid with show and hide filter options. Initially filter is disabled. When i click show filter button it is displaying the filter but pageritem in the bottom is not displaying if i click hide button the pageritem is displaying. (Please see the Iamges) I set " PagerStyle-AlwaysVisible="true" ". But still no luck. Can anyone help me how to fix this? ( I am reposting this thread because I am unable to upload pics to my previous post)
Here is my code
I have radgrid with show and hide filter options. Initially filter is disabled. When i click show filter button it is displaying the filter but pageritem in the bottom is not displaying if i click hide button the pageritem is displaying. (Please see the Iamges) I set " PagerStyle-AlwaysVisible="true" ". But still no luck. Can anyone help me how to fix this? ( I am reposting this thread because I am unable to upload pics to my previous post)
Here is my code
<
div
style
=
"width: 98%; overflow: auto; overflow-y: hidden"
>
<
telerik:RadGrid
ID
=
"gvPjtMnt"
runat
=
"server"
Height
=
"600px"
AutoGenerateColumns
=
"false"
BorderWidth
=
"2px"
BorderStyle
=
"Solid"
BackColor
=
"White"
AllowPaging
=
"True"
PagerStyle-AlwaysVisible
=
"true"
PageSize
=
"20"
AllowSorting
=
"True"
AllowFilteringByColumn
=
"true"
OnNeedDataSource
=
"gvPjtMnt_OnNeedDataSource"
OnItemCommand
=
"gvPjtMnt_ItemCommand"
OnItemCreated
=
"gvPjtMnt_ItemCreated"
EnableViewState
=
"true"
>
<
HeaderStyle
Height
=
"20px"
BackColor
=
"#004000"
Font-Size
=
"8pt"
Font-Bold
=
"True"
ForeColor
=
"White"
HorizontalAlign
=
"Center"
BorderColor
=
"White"
BorderWidth
=
"1px"
/>
<
AlternatingItemStyle
Font-Size
=
"8pt"
BackColor
=
"#F5F5E9"
HorizontalAlign
=
"Center"
BorderWidth
=
"1px"
BorderColor
=
"White"
/>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
<
MasterTableView
GridLines
=
"None"
CommandItemDisplay
=
"Top"
DataKeyNames
=
"ProjectId"
HorizontalAlign
=
"Center"
AllowFilteringByColumn
=
"true"
>
<
CommandItemTemplate
>
<
table
style
=
"width: 100%"
>
<
tr
>
<
td
align
=
"right"
style
=
"width: 80%"
>
<
asp:LinkButton
ID
=
"lnkshwFilter"
Text
=
"ShowFilter"
Font-Underline
=
"true"
ForeColor
=
"MidnightBlue"
runat
=
"server"
OnClientClick
=
"return showFilterItem()"
/>
<
asp:LinkButton
ID
=
"lnkhdFilter"
Text
=
"HideFilter"
Font-Underline
=
"true"
ForeColor
=
"MidnightBlue"
runat
=
"server"
OnClientClick
=
"return hideFilterItem()"
/>
</
td
>
<
td
align
=
"right"
style
=
"height: 10px;"
>
Total Records found: <
asp:Label
ID
=
"lblTotRecCount"
runat
=
"server"
Font-Bold
=
"True"
Font-Size
=
"10pt"
ForeColor
=
"Black"
Text
=
"0"
></
asp:Label
>
</
td
>
<
td
align
=
"right"
style
=
"width: 5%"
>
<
asp:ImageButton
ID
=
"ExportToExcelButton"
runat
=
"server"
ImageUrl
=
"~/images/ExportToExcel.gif"
ToolTip
=
"Export to Excel"
OnClick
=
"ExportExcel_Click"
/>
</
td
>
</
tr
>
</
table
>
</
CommandItemTemplate
>
<
Columns
>
........
some columns here.......
</
Columns
>
<
ItemStyle
ForeColor
=
"#3C5F22"
Font-Size
=
"8pt"
BackColor
=
"White"
BorderWidth
=
"0px"
BorderColor
=
"White"
/>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
AlwaysVisible
=
"true"
/>
</
MasterTableView
>
<
ClientSettings
AllowColumnsReorder
=
"true"
>
<
ClientEvents
OnGridCreated
=
"GridCreated"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
<
Resizing
AllowColumnResize
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
</
div
>
function showFilterItem() {
$find('<%=gvPjtMnt.ClientID %>').get_masterTableView().showFilterItem();
document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkhdFilter').style.display = 'block';
document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkshwFilter').style.display = 'none';
return false;
}
function hideFilterItem() {
document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkhdFilter').style.display = 'none';
document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkshwFilter').style.display = 'block';
$find('<%=gvPjtMnt.ClientID %>').get_masterTableView().hideFilterItem();
return false;
}
function GridCreated(sender, args) {
sender.get_masterTableView().hideFilterItem();
}
protected
void
gvPjtMnt_ItemCreated(
object
sender, GridItemEventArgs e)
{
try
{
if
(e.Item
is
GridCommandItem)
{
LinkButton st = (LinkButton)e.Item.FindControl(
"lnkhdFilter"
);
st.Style[
"display"
] =
"none"
;
}
}
catch
(Exception ex)
{
}
}