나는 asp.net gridview 및 ajax 달력 익스텐더를 사용하고 있습니다. 예를 들어 사용자가 19/8/16과 같이 날짜를 선택하면 gridview 테이블에서만 19/8/16의 날짜가 표시됩니다. 그러나 문제는 내가 숨기고 gridview 표시 할 코드를 모른다. 누구든지 gridview를 숨기고 표시하는 방법을 알고 있습니까?Gridview 테이블을 숨기고 표시하는 방법은 무엇입니까?
출력 :
Asp.net 코드 :
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ViewAppliedLeaveByDate.aspx.cs" Inherits="BookReservation.ViewLeave.ViewAppliedLeaveByDate" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<h3>View Leave Application By Start Date</h3>
<asp:Label ID="lblSearchStartDate" runat="server" CssClass="labelClass" Text="Search By Start Date:"></asp:Label>
<asp:TextBox ID="tbSearchStartDate" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="tbSearchStartDate_CalendarExtender" runat="server" TargetControlID="tbSearchStartDate" />
<br />
<br />
<asp:GridView ID="gvVALD" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSSearchStartDate" >
<Columns>
<asp:BoundField DataField="StaffName" HeaderText="StaffName" SortExpression="StaffName" />
<asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
<asp:BoundField DataField="StartDate" HeaderText="StartDate" SortExpression="StartDate" />
<asp:BoundField DataField="Start Leave Period" HeaderText="Start Leave Period" SortExpression="Start Leave Period" />
<asp:BoundField DataField="EndDate" HeaderText="EndDate" SortExpression="EndDate" />
<asp:BoundField DataField="End Leave Period" HeaderText="End Leave Period" SortExpression="End Leave Period" />
<asp:BoundField DataField="NumDays" HeaderText="NumDays" SortExpression="NumDays" />
</Columns>
</asp:GridView>
<br />
<asp:SqlDataSource ID="SqlDSSearchStartDate" runat="server" ConnectionString="<%$ ConnectionStrings:LeaveManagementCS %>" SelectCommand="SELECT Staff.StaffName, LeaveType.Type, LeaveApplications.StartDate, LeavePeriod.Description AS [Start Leave Period], LeaveApplications.EndDate, LeavePeriod.Description AS [End Leave Period], LeaveApplications.NumDays FROM LeaveApplications INNER JOIN LeavePeriod ON LeaveApplications.StartLeavePeriodId = LeavePeriod.LeavePeriodId AND LeaveApplications.EndLeavePeriodId = LeavePeriod.LeavePeriodId INNER JOIN LeaveType ON LeaveApplications.LeaveTypeId = LeaveType.Id INNER JOIN Staff ON LeaveApplications.StaffId = Staff.StaffId"></asp:SqlDataSource>
</asp:Content>
Asp.net.cs 코드 :
public partial class ViewAppliedLeaveByDate : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
하고 당신은있는 gridview를 보충 할 필요가 'tbSearchStartDate' 텍스트에 이벤트 – Webruster
가 숨기고 싶은 조건을 변경 했습니까? –