cursor position in autocompletebox

3 posts, 0 answers
  1. Abhi
    Abhi avatar
    38 posts
    Member since:
    Nov 2012

    Posted 25 Dec 2012 Link to this post

    Hi,
            When I select an item from the autocomplete box, the text displayed in the box is the last portion of the text. I would like to display the first portion instead.(i.e,...pointing the cursor to the start of the text in mvvm pattern)  
  2. sanjay
    sanjay avatar
    20 posts
    Member since:
    Apr 2011

    Posted 31 Dec 2012 Link to this post

    Hi Abhi

    Find the textbox of autocompletebox through visual tree helper.

    Textbox txt= VisualTreeHelper.GetChild(VisualTreeHelper.GetChild("AutoCompleteBoxName", 0), 0) as TextBox;

    txt.select(0,0)   wii place cursor position at first letter always.


    http://stackoverflow.com/questions/1049657/how-to-access-the-textbox-in-a-sl3-autocompletebox


    Regards
    Sanjay
  3. DevCraft banner
  4. Abhi
    Abhi avatar
    38 posts
    Member since:
    Nov 2012

    Posted 02 Jan 2013 Link to this post

    thanks sanjay,
    I got it
Back to Top