Hi All,
I have a RadGrid and a lable as shown below.
| <telerik:AjaxSetting AjaxControlID="grdOverdue"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="grdOverdue"/> |
| <telerik:AjaxUpdatedControl ControlID="lblError"/> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <asp:Label ID="lblError" runat="server" Text="" Visible="false" SkinID="Error"></asp:Label> |
| <telerik:RadGrid ID="grdOverdue" runat="server" |
| .... |
| <CommandItemTemplate> |
| <span style="float:left;margin-left:5px;"> |
| <asp:Label ID="lblJobCount" runat="server" Text=""></asp:Label> |
| </span> |
| <span style="float:right;margin-right:5px;"> |
| <asp:LinkButton ID="lbExportAll" runat="server" CommandName="ExportToExcel">Export All</asp:LinkButton> | |
| <asp:LinkButton ID="lbExportSelected" runat="server" CommandName="ExportSelectedToExcel"> Export Selected</asp:LinkButton> |
| </span> |
| </CommandItemTemplate> |
| .... |
| </telerik:RadGrid> |
and in the grdOverdue_ItemCommand event I am displaying error message if the user has not selected atleast one item in the grid.
| protected void grdOverdue_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if (e.CommandName == "ExportSelectedToExcel") |
| { |
| if (selectedJobs.Count == 0) |
| { |
| lblError.Visible = true; |
| lblError.Text = "Please select atleast one job to export."; |
| } |
| else{ |
| lblError.Visible = false; // this is not working. |
| } |
| } |
| } |
Please suggest how to clear the error message and make the label invisible? Thank you.