Sulieman Alkatib

Sulieman Alkatib

  • NA
  • 56
  • 4.7k

open a gridview of specific date using calendar

Jan 10 2017 8:36 AM
I have problem to extract attendance information of selected date on calendar so I make a triky code which assign selected date from calendar to a textbox and then a gridview should appear that have a column value = textbox value or something like this
 
  1. Public Class Attendance  
  2.     Inherits System.Web.UI.Page  
  3.   
  4.     Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
  5.         Calendar1.Visible = False  
  6.     End Sub  
  7.   
  8.     Protected Sub Button1_Click(ByVal sender As ObjectByVal e As EventArgs) Handles Button1.Click  
  9.         Calendar1.Visible = True  
  10.     End Sub  
  11.   
  12.     Protected Sub Calendar1_SelectionChanged(ByVal sender As ObjectByVal e As EventArgs) Handles Calendar1.SelectionChanged  
  13.         TextBox1.Text = Calendar1.SelectedDate  
  14.   
  15.   
  16.         
  17.     End Sub  
  18. End Class  
  1. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"   
  2.         DataSourceID="SqlDataSource2" EnableModelValidation="True">  
  3.         <Columns>  
  4.             <asp:BoundField DataField="EID" HeaderText="EID" SortExpression="EID" />  
  5.             <asp:BoundField DataField="DateOfDay" HeaderText="DateOfDay"   
  6.                 SortExpression="DateOfDay" />  
  7.             <asp:CheckBoxField DataField="Present" HeaderText="Present"   
  8.                 SortExpression="Present" />  
  9.         </Columns>  
  10.     </asp:GridView>  
 so now I need to filter the result of gridview by selected date
 
 
thanks developers 

Answers (4)