.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Slash(/) in Combobox

Posted By: haider     Posted Date: November 18, 2016    Points:5   Category :ASP.Net
Hi every one
i have a combobox used to enter date in to db
how can put a slashes(/) to enter a date like this dd/mm/yyyy

i working on asp.net web application 2010 and sql server db

any help will appreciated

Author: Akhil Raj       [Moderator]      
Posted Date: November 30, 2016     Points: 20   


Can you please explain how you doing this. You mean separate combo box for day , month and year? Then when submit you can concatenate the string from combo boxes.

Please update if my understanding wrong

Author: andrajoseph             
Posted Date: November 30, 2016     Points: 20   

I've just come across this same issue in VB 2012, and can't believe that Microsoft haven't come up a fix for it yet!

Anyway, just for the record, my solution has been to add a little bit of code to the validating method of the combobox which then selects the first matching item:
Private Sub cbCode_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles cbCode.Validating

'VB has a nasty bug in autocomplete when a string contains / or \
Dim s As String

If cbCode.SelectedIndex = -1 And cbCode.Text <> "" Then
' Let's see if it ends with a slash
s = cbCode.Text
If s.EndsWith("\") Or s.EndsWith("/") Then cbCode.SelectedIndex = cbCode.FindString(s)
End If

End Sub

We are provide a more idea .visit us @ http://www.traininginannanagar.in/python-training-in-chennai.html | http://www.traininginannanagar.in/r-programming-training-in-chennai.html | http://www.traininginannanagar.in/dot-net-training-in-chennai.html | http://www.traininginannanagar.in/software-testing-training-in-chennai.html | http://www.traininginannanagar.in/data-analytics-training-in-chennai.html

Author: david stephan             
Posted Date: December 28, 2016     Points: 20   

Thanks andrajoseph for your helpful reply but its not clear know, please explain more. I think you have skip one string. Please check and reply asap.

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend