I have the following in the CommandItemTemplate tag:
I have the followinfg code but it isn't working.
Any ideas?
Thanks for the help.
<
CommandItemTemplate>
<table width="100%">
<tr>
<td align="left">Third Party Mismatches</td>
<td align="right">
<asp:LinkButton ID="showFilter" runat="server" CommandName="DisplayFilter"
Text="Filter">
</asp:LinkButton>
</td>
</tr>
</table>
</
CommandItemTemplate>
What i want to do is when the user clicks on the showFilter link it will display or hide the folter depending on if it is shown already or not. I have that part working. What I can't get is to change the text to "Show Filter" if the filter is hidden and "Hide Filter" if it is shown.
I have the followinfg code but it isn't working.
Protected Sub GrdThirdParty_ItemCommand(ByVal source As Object, _ |
ByVal e As GridCommandEventArgs) _ |
Handles GrdThirdParty.ItemCommand |
If e.CommandName = "DisplayFilter" Then |
Dim lnkButton As LinkButton = CType(e.Item.FindControl("showFilter"), LinkButton) |
If GrdThirdParty.AllowFilteringByColumn = False Then |
GrdThirdParty.AllowFilteringByColumn = True |
lnkButton.Text = "Hide Filter" |
Else |
GrdThirdParty.AllowFilteringByColumn = False |
lnkButton.Text = "Show Filter" |
End If |
GrdThirdParty.MasterTableView.Rebind() |
End If |
End Sub |
Thanks for the help.