Telerik
Home / Community / Code Library / RadControls for ASP.NET and ASP.NET AJAX: Grid / Building a RadDatePicker custom column editor for RadGrid

Building a RadDatePicker custom column editor for RadGrid

Feed from this thread
  • Posted on May 11, 2006 (permalink)


    Requirements

    r.a.d.grid

    3.2

    r.a.d.calendar

    1.6

    .NET version

    1.x

    Visual Studio version

    2003

    programming language

    VB

    browser support

    all browsers supported by r.a.d.grid and r.a.d.calendar

     
    The RadGrid control supports building your own custom column editors.  These are ideal if you want to customize your users' editing experience.

    A custom column editor has to inherit from one of the base editor classes, our example will inherit from GridTextColumnEditor.  The two most important methods that have to be overriden are AddControlsToContainer and LoadControlsFromContainer.  The former has to create the editor's controls and add them to the container's controls collection.  The latter extracts information from the container's controls:

    Protected Overrides Sub AddControlsToContainer()
        picker = New RadDatePicker
        picker.ID = "editPicker"
        ContainerControl.Controls.Add(picker)
    End Sub

    Protected Overrides Sub LoadControlsFromContainer()
        picker = ContainerControl.Controls(0)
    End Sub


    The tricky part is to remember to set an ID to all controls that you create.  This is generally a good ASP.NET programming practice and can save you a lot of hunting for postback events not being fired and viewstate not being loaded.
     

    Reply

  • Richard Fan avatar

    Posted on Sep 19, 2006 (permalink)

    It works! I met another issue: the date will automatically set as 1/1/1980 if user leave the datepicker blank. How can I make the date = null in this case?

    Reply

  • Telerik Admin admin's avatar

    Posted on Sep 20, 2006 (permalink)

    Hi Richard,

    We have attached the sample application we sent you in the support ticket you opened on the same topic.

    I hope it will serve as a future reference for other telerik clients too.


    Best wishes,
    Manuel

    the telerik team
    Attached files

    Reply

  • Ningo avatar

    Posted on Dec 6, 2007 (permalink)

    Hi!

    is there a Demo-Project for c# also?

    Thank you!

    Reply

  • Telerik Admin admin's avatar

    Posted on Dec 7, 2007 (permalink)

    Hi Ningo,

    We have attached a C# project that achieves the same functioanlity (also attached is a calendar hotfix build that fixes some apperance issues with datepickers within grid edit item templates).

    Hope this helps.


    Kind regards,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Ningo avatar

    Posted on Dec 7, 2007 (permalink)

    Thank you!

    Just for your Information:

    If i try to run the Demo Code i get the errormessage

    System.InvalidOperationException: This control is compiled for ASP.NET 1.x. Please use the ASP.NET 2.0 native version: RadGrid.Net2.dll



    Ningo

    Reply

  • Telerik Admin admin's avatar

    Posted on Dec 7, 2007 (permalink)

    Hi Ningo,

    The attached project is a C# project for .Net 1.x as the original project was for that framework version and you have not indicated a preferred .Net version. However, there is nothing specific to .Net1.x here so you should be able to easily convert the project to a .Net2.0 website.

    Let us know if you have any problems.


    All the best,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Matthew avatar

    Posted on Jul 10, 2008 (permalink)

    Hi, I am using RadUpload version 2.3.2 in VS 2003.  My site works fine when I set the .NET CLR version in IIS to 1.1.  It breaks, however, with the following error message, when I set the CLR version to 2.0.

    "This control is complied for ASP.NET 1.x. Please use the ASP.NET 2.0 native version"

    I need to use 2.0 framework, and I saw that someone else had run into the same problem.  What is the solution to this problem?

    Thank you in advance.

    Stack trace:

    [InvalidOperationException: This control is complied for ASP.NET 1.x. Please use the ASP.NET 2.0 native version: RadUpload.Net2.dll]
       Telerik.RadUploadUtils.RadControl.OnInit(EventArgs e) +101
       Telerik.WebControls.RadUpload.OnInit(EventArgs e) +10
       System.Web.UI.Control.InitRecursive(Control namingContainer) +321
       System.Web.UI.Control.InitRecursive(Control namingContainer) +198
       System.Web.UI.Control.InitRecursive(Control namingContainer) +198
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +834

    Reply

  • Telerik Admin admin's avatar

    Posted on Jul 11, 2008 (permalink)

    Hi Matthew,

    You can use RadUpload.Net2.dll for .NET 2.0.

    Greetings,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

Powered by Sitefinity ASP.NET CMS

Contact Us | Site Feedback | Terms of Use | Privacy Policy
Copyright © 2002-2009 Telerik. All rights reserved.