ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.[Solved] MKB TimePicker displays Current Time if value is 00:00 in ASP.Net<p>Hi&nbsp;<a href="mailto:suraj@123,">suraj@123,</a></p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;asp:GridView runat=&#34;server&#34; ID=&#34;GridView1&#34; AutoGenerateColumns=&#34;false&#34;&gt; &lt;Columns&gt; &lt;asp:BoundField DataField=&#34;Id&#34; HeaderText=&#34;Id&#34; /&gt; &lt;asp:TemplateField HeaderText=&#34;Departure&#34; ItemStyle-HorizontalAlign=&#34;Center&#34; ItemStyle-Wrap=&#34;true&#34;&gt; &lt;ItemTemplate&gt; &lt;cc1:TimeSelector ID=&#34;tmsDepartureTime&#34; ClientIDMode=&#34;Predictable&#34; Hour=&#39;&lt;%# Eval(&#34;DepartureTime&#34;).ToString()==&#34;&#34;?8:Convert.ToDateTime(Eval(&#34;DepartureTime&#34;).ToString()).Hour %&gt;&#39; Minute=&#39;&lt;%# Eval(&#34;DepartureTime&#34;).ToString()==&#34;&#34;?0:Convert.ToDateTime(Eval(&#34;DepartureTime&#34;).ToString()).Minute %&gt;&#39; AmPm=&#39;&lt;%# Eval(&#34;DepartureTime&#34;).ToString()==&#34;&#34;?TimeSelector.AmPmSpec.AM:(Convert.ToInt32(Convert.ToDateTime(Eval(&#34;DepartureTime&#34;).ToString()).Hour)&lt;12)?TimeSelector.AmPmSpec.AM:TimeSelector.AmPmSpec.PM %&gt;&#39; MinuteIncrement=&#34;1&#34; CssClass=&#34;TimePicker&#34; runat=&#34;server&#34; Font-Size=&#34;Larger&#34; DisplaySeconds=&#34;false&#34; SelectedTimeFormat=&#34;Twelve&#34;&gt; &lt;/cc1:TimeSelector&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt;</pre> <p><strong><span style="text-decoration: underline;">Code</span></strong></p> <p><strong>C#</strong></p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { System.Data.DataTable dt = new System.Data.DataTable(); dt.Columns.AddRange(new System.Data.DataColumn[2] { new System.Data.DataColumn(&#34;Id&#34;, typeof(int)), new System.Data.DataColumn(&#34;DepartureTime&#34;, typeof(DateTime)) }); dt.Rows.Add(1, &#34;04/26/2018 14:10&#34;); dt.Rows.Add(2, &#34;04/26/2018 05:00&#34;); GridView1.DataSource = dt; GridView1.DataBind(); } }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) If Not Me.IsPostBack Then Dim dt As System.Data.DataTable = New System.Data.DataTable() dt.Columns.AddRange(New System.Data.DataColumn(1) {New System.Data.DataColumn(&#34;Id&#34;, GetType(Integer)), New System.Data.DataColumn(&#34;DepartureTime&#34;, GetType(DateTime))}) dt.Rows.Add(1, &#34;04/26/2018 14:10&#34;) dt.Rows.Add(2, &#34;04/26/2018 05:00&#34;) GridView1.DataSource = dt GridView1.DataBind() End If End Sub</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/OznZAth.jpg" alt="" width="254" height="216" /></span></strong></p>https://www.aspforums.net:443/Threads/329220/Solved-MKB-TimePicker-displays-Current-Time-if-value-is-0000-in-ASPNet/https://www.aspforums.net:443/Threads/329220/Solved-MKB-TimePicker-displays-Current-Time-if-value-is-0000-in-ASPNet/Thu, 26 Apr 2018 06:49:09 GMT