Hi Mudassar,
I am developing a web application where i have to use GridView.I need to implement fallowing functionalities.
1.Provide a column for selecting Start Date and End Date and update the date selected to database.
2.Provide a column for Start Time and End Time and update it to database.
I can implement these and read values usinjg Ajax Calender extender ,but the problem is whenever i try to bind the data back from database to same grid, then time value from database does not bind to time picker and also date value does not bind to date picker.
however i tried with jQuery,but i am unable to implement correctly.I am fallowing youe examples and it has helped me a lot.Please help me solve this also.
Thanks in advance.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.js"></script>
<link href="Scripts/jquery-ui-timepicker-addon.css" rel="stylesheet" />
<script src="Scripts/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript">
$(function () {
$("[id$=txtEndDate]").datepicker({
numberOfMonths: 2,
minDate: 0,
maxDate: 30
});
$("#txtStartDateFoot").datepicker({
numberOfMonths: 2,
minDate: 0,
maxDate: 30
});
});
</script>
</head>
<body>
<form runat="server">
<asp:GridView ID="GridView1" AutoGenerateColumns="False"
AutoGenerateEditButton="True" runat="server" DataSourceID="SqlDataSource1">
<Columns>
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
<asp:TextBox ID="txtStartDate" ClientIDMode="Static" runat="server" />
</ItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtStartDateFoot" ClientIDMode="Static" runat="server" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:AdventureWorks2012ConnectionString %>"
SelectCommand="SELECT * FROM [DateTbl]"></asp:SqlDataSource>
</form>
</body>
</html>