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

  • SEARCH
  • Home
  • 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 7870123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:31:30+00:00 2026-06-03T01:31:30+00:00

I’m using MT.D to list out staff in a DialogViewController. EnableSearch is on and

  • 0

I’m using MT.D to list out staff in a DialogViewController. EnableSearch is on and you can filter items that are in the list. However, if you push to another view, then come back, the search bar is empty. I was able to get it to restore the search query used by overriding OnSearchTextChanged (string text) and storing the string to a local field, and when the view comes back into focus, I use the following code:

public override ViewDidAppear (bool animated)
{
    base.ViewDidAppear (animated);
    if (EnableSearch && !string.IsNullOrWhiteSpace (lastSearchQuery))
    {
        this.SearchButtonClicked (lastSearchQuery); // this inserts text
        this.StartSearch (); // no clue what this is doing
        this.ReloadData (); // does nothing but was worth a try
    }
}

That code inserts the text into the search bar and shows it, but I can’t get it to filter unless you type something. The keyboard is brought into view and there is a search button but it does nothing. Any suggestions?

  • 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-06-03T01:31:31+00:00Added an answer on June 3, 2026 at 1:31 am

    I think all you are missing is a call to PerformFilter on the DialogViewController.

    I typed up a quick sample to show the behavior. I never did see the exact behavior you observed. I did not have to repopulate the search field. For reference I am using Monotouch 5.2.11.

    using System;
    using System.Linq;
    using MonoTouch.UIKit;
    using MonoTouch.Dialog;
    using MonoTouch.Foundation;
    
    namespace delete201204242A
    {
        [Register ("AppDelegate")]
        public partial class AppDelegate : UIApplicationDelegate
        {
            UIWindow _window;
            UINavigationController _nav;
            MyDialogViewController _rootVC;
    
            public override bool FinishedLaunching (UIApplication app, NSDictionary options)
            {
                _window = new UIWindow (UIScreen.MainScreen.Bounds);
    
                RootElement _rootElement = new RootElement ("LINQ root element") {
                    new Section ("List") {
                        from x in new Expense [] { new Expense () {Name="one"}, new Expense () {Name="two"}, new Expense () {Name="three"} }
                        select (Element)new BindingContext (null, x, x.Name).Root
                    }
                };
    
                _rootVC = new MyDialogViewController (_rootElement);
                _rootVC.EnableSearch = true;
                _nav = new UINavigationController (_rootVC);
    
                _window.RootViewController = _nav;
    
                _window.MakeKeyAndVisible ();
    
                return true;
            }
    
            public class MyDialogViewController : DialogViewController
            {
                public MyDialogViewController (RootElement root) : base (root) {}
    
                public string SearchString { get; set; }            
                public override void ViewDidAppear (bool animated)
                {
                    base.ViewDidAppear (animated);
                    if (!string.IsNullOrEmpty (SearchString))
                        this.PerformFilter (SearchString);
                }
                public override void OnSearchTextChanged (string text)
                {
                    base.OnSearchTextChanged (text);
                    SearchString = text;
                }
            }
    
            public class Expense
            {
                [Section("Expense Entry")]
    
                [Entry("Enter expense name")]
                public string Name;
                [Section("Expense Details")]
    
                [Caption("Description")]
                [Entry]
                public string Details;
            }
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a

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.