skip navigation
Telerik UI for ASP.NET AJAX
Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
NEW
: Design Kits for Figma
Online Training
Document Processing Library
Embedded Reporting for web and desktop
Web
Kendo UI
UI for jQuery
UI for Angular
UI for React
UI for Vue
UI for Blazor
UI for ASP.NET Core
UI for ASP.NET MVC
UI for ASP.NET AJAX
Mobile
UI for .NET MAUI
UI for Xamarin
Document Management
Telerik Document Processing
Desktop
UI for .NET MAUI
UI for WinUI
UI for WinForms
UI for WPF
Reporting & Mocking
Telerik Reporting
Telerik Report Server
Telerik JustMock
Automated Testing
Test Studio
Test Studio Dev Edition
CMS
Sitefinity
UI/UX Tools
ThemeBuilder
Design System Kit
Debugging
Fiddler
Fiddler Everywhere
Fiddler Classic
Fiddler Jam
FiddlerCap
FiddlerCore
Free Tools
VB.NET to C# Converter
Testing Framework
View all products
Overview
Demos
Roadmap
What's New
Roadmap
Release History
Migrate to Blazor
Docs & Support
Support and Learning
Support and Learning Hub
Docs
Demos
Virtual Classroom
Forums
Videos
Blogs
Accessibility and Security
Submit a Ticket
Productivity and Design Tools
Visual Studio Extensions
ThemeBuilder
Embedded Reporting
Pricing
Shopping cart
Login
Contact Us
Try now
close mobile menu
Telerik Forums
/
UI for ASP.NET AJAX
This is a migrated thread and some comments may be shown as answers.
Documentation on GridDateTimeColumn
2 Answers
146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
briankb
Top achievements
Rank 2
briankb
asked on
21 Aug 2008,
03:44 PM
I'm trying to use the GridDateTimeColumn in a RADGrid vQ2 2008 Ajax.
I couldn't find any documentation.
Things I would like to do with it.
show date picker onClick
specify a default date (today) when the field is empty or when it is an insert
validation
Add a comment
Submit comment
Cancel
2 Answers
, 1 is accepted
Sort by
Score
Date
0
Leon
Top achievements
Rank 1
answered on
21 Aug 2008,
07:13 PM
Briankb,
A possible option would be to use the built-in
Grid editors
,
GridDateTimeColumnEditor
in this case. See the code-behind on the demo below which demonstrates dynamic validation through the Column editor in ItemCreated Grid event:
http://www.telerik.com/demos/aspnet/prometheus/Grid/Examples/Programming/WebGrid/DefaultCS.aspx
Note that you can also access the DatePicker through the Controls collection of the cell as well and set its default value or anything else.
Hope that helps!
~Leon
Add a comment
Submit comment
Cancel
0
briankb
Top achievements
Rank 2
answered on
25 Oct 2008,
07:04 AM
I found the following code to push a date into the GridDateTimeColumn However I need it to only do so if the date is empty so I added the 5th line:
If
dtpkr.SelectedDate.HasValue =
False
Then
I'm using the following code.
Protected
Sub
RadGrid1_ItemDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridItemEventArgs)
Handles
RadGrid1.ItemDataBound
If
(
TypeOf
e.Item
Is
GridEditableItem)
AndAlso
(e.Item.IsInEditMode)
Then
Dim
item
As
GridEditableItem =
DirectCast
(e.Item, GridEditableItem)
Dim
dtpkr
As
RadDatePicker =
DirectCast
(item(
"ContentPublished"
).Controls(0), RadDatePicker)
If
dtpkr.SelectedDate.HasValue =
False
Then
dtpkr.SelectedDate = DateTime.Today
End
If
dtpkr.FocusedDate = DateTime.Today
End
If
End
Sub
I added this reply for my own future reference. If there is a better way or you have additional comments please reply as well.
Add a comment
Submit comment
Cancel
Answer this question
Drag and drop files here or
browse
to attach...
Browse
for files to attach...
Supported file types: PNG, JPG, JPEG, ZIP, RAR, TXT. Max total file size - 20MB.
Submit answer
Cancel
Tags
Grid
Asked by
briankb
Top achievements
Rank 2
Answers by
Leon
Top achievements
Rank 1
briankb
Top achievements
Rank 2
Share this question
or
Copy link