Gridview rowupdating textbox value
Bipin Joshi is a software consultant, trainer, author, and yoga mentor having 24 years of experience in software development, consulting, and training.
He conducts instructor-led online training courses in ASP. NET MVC, and Design Patterns for individuals and small groups.
I am sharing this because I see a lot of questions on the forums on how to get the value from the Grid View object, and I know how.
The reason for this odd behavior is that the date input type needs date in ISO format (yyyy-MM-dd) if it has to display it correctly. NET dates are MM/dd/yyyy and hence the date-picker fails to show them correctly.To make the data entry easy you decide to use HTML5 date input type.A Bound Field of a Grid View always uses a plain Text Box (type = "text") to use HTML5 date input type you need to add a Template Field to the Grid View.But ensure that the control/link is inside the Grid View, only then can we cast sender as Grid View.
This code is a bit complex but just add it knowing that we may refer to it in the future.
If you are not using any data source control or model binding for databinding purpose, you may need to handle the date conversion during update operation also.