Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7522475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:32:00+00:00 2026-05-30T02:32:00+00:00

In MonoTouch.Dialog what do I need to do to make datetime pickers have and

  • 0

In MonoTouch.Dialog what do I need to do to make datetime pickers have and “ok” and “cancel” option?

In this example code when you click a DateTime element you navigate to the picker screen there is no way to select or cancel after you navigate to the date picker.

[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
    protected UIWindow window;
    protected UINavigationController navigationController;
    protected RootElement rootElement;
    protected DialogViewController dialogViewController;        

    public override bool FinishedLaunching (UIApplication app, NSDictionary options)
    {
        window = new UIWindow (UIScreen.MainScreen.Bounds);
        var navigationController = new UINavigationController();
        window.AddSubview (navigationController.View);
        window.MakeKeyAndVisible ();

        rootElement = CreateJsonItems();
        dialogViewController = new DialogViewController (rootElement, true);
        navigationController.PushViewController (dialogViewController, true);

        return true;
    }

    protected RootElement CreateJsonItems()
    {
        var json = 
            @"{
                ""title"": ""Json Sample"",
                ""sections"": [{
                    ""header"": ""Dates and Times"",
                    ""elements"": [{
                        ""type"": ""datetime"",
                        ""caption"": ""Date and Time"",
                        ""value"": ""Sat, 01 Nov 2008 19:35:00 GMT""
                    }, {
                        ""type"": ""date"",
                        ""caption"": ""Date"",
                        ""value"": ""10/10""
                    }, {
                        ""type"": ""time"",
                        ""caption"": ""Time"",
                        ""value"": ""11:23""
                    }]
                }]
            }";

        using(var reader = new StringReader(json))
        {
            var jsonObject = JsonObject.Load(reader) as JsonObject;
            var jsonElement = JsonElement.FromJson(jsonObject);
            return jsonElement;
        }
    }
}

Thank you Poupou! after applying your advice this is the code that fixed it.

public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
    window = new UIWindow (UIScreen.MainScreen.Bounds);
    rootElement = CreateJsonItems();
    var dialogViewController = new DialogViewController(rootElement);
    navigationController = new UINavigationController(dialogViewController);
    window.Add (navigationController.View);
    window.MakeKeyAndVisible ();
    return true;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:32:01+00:00Added an answer on May 30, 2026 at 2:32 am

    When used like this in MonoTouch.Dialog the pickers are not modal. So it’s the navigation UI that will let you go back to the previous view. OTOH that will be hidden by doing this:

       var navigationController = new UINavigationController();
       window.AddSubview (navigationController.View);
    

    note: it’s also a (different) problem since that won’t keep a reference to navigationController.

    You should try to replace the above (and move it after the creation of your DialogViewController) with:

       window.RootViewController = dialogViewController;
    

    That should let the default navigation UI come back and allow you to go back from the date picker.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code example to demonstrate a simple MonoTouch.Dialog table using MessageElement
I have an element in my Monotouch.Dialog Controller that discloses a list of possible
I wanna customize cells in MonoTouch.Dialog. For example make custom background in BoolElement and
Is this possible at all? When I create a form using MonoTouch.Dialog, it comes
Any MonoTouch Solution I create has this issue, If I make any change to
Monotouch 5.0.2. Running the simple code below I get this in the output panel:
I want to use MonoTouch.Dialog RadioElements for selecting data and it has to have
I want to style Monotouch Dialog Section like this (change the blue background to
In the March 31 release of MonoTouch.Dialog we aren't able to set the color
I am trying to implement a Settings dialog for iOS using MonoTouch and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.