[WPF] AutoCompleteBox: oblige the user to select only items in list

Hi,
I'm using AutoCompleteBox from Codeplex.com
Is there a way for oblige the user to select only items shown in list?
I would avoid that user can to insert custom words in database.
Thanks.

Hi robertino_salemi ,
In my experience, if you want to "avoid custom words and insert into database", I suggest that you could check these words before user inserts into database.
I have made a code sample , suppose there is a button, it will check the value when click the button. you can refer to code below.
You can also use the other event ,such as LostFocus,MouseLeave etc.
<toolkit:AutoCompleteBox x:Name="autoTextbox" Width="150" Height="30" SelectedItem="{Binding}"></toolkit:AutoCompleteBox>
<Button Width="100" Height="30" Content="submit" Click="Button_Click"></Button>
List<string> ls = new List<string>();
public MainWindow()
InitializeComponent();
ls.Add("abc" );
ls.Add( "acc" );
ls.Add("affc" );
autoTextbox.ItemsSource = ls;
private void Button_Click(object sender, RoutedEventArgs e)
if(!ls.Contains(autoTextbox.Text.Trim()))
MessageBox.Show("Error data!");
return;
Best Regards,
Eoro

Similar Messages

  • Allow user to select each item in list item only once.

    Hi,
    What is the best way to go to stop the user selecting the same item in a list item more than one.
    I have a multi record block, the user can select values 1-10 for each record, but they should not be allowed to select duplicates.
    Thanks for any help!

    Hi,
    Suppose you have 4 list items A,B,C,D in block "test" and same 4 values in each list item. Now you want that, no two values selected by user in list item should be same.
    On when-validate-item of list item B write code like :
    If :test.A is null then
    Message('First A must be enter");
    Raise form_trigger_failure;
    end if;
    If :test.B = :test.A then
    Message('value already in list item A');
    Raise form_trigger_failure;
    end if;
    Now, for C same code with a addition of condition for B with OR operator like:
    If :test.C = :test.A or then :test.C = :test.B
    Like that.... you can achive your functionality.
    But one restriction is that user has to enter values in list item in a pre-defined order only....
    Hope that it would work for you.....

  • Reader SDK: any way to see what text the user has selected?

    I'm using the Adobe Reader SDK with C#, looking at the interapplication communication features.
    I can open a document in Reader and allow the user to user the reader tools like select text, etc.
    Here's the problem: I want to have my application know what text the user currently has selected.  And I'd like it to know the name of the field that the user has selected, not just the text of the field.
    Microsoft Office's Interop has something like this:
    currentDocument.GetSelectedText();
    Is there any way to do this with IAC or the javascript or plug-in features of the Reader SDK?
    If not, can it be done with the Acrobat API?  I've looked through both sets of documentation, and haven't found what i needed.
    Thanks for any help!

    To write a plug-in for the Adobe Reader you need to go through 2 separate steps.
    Step one - Download the Adobe Acrobat SDK (from here http://www.adobe.com/devnet/acrobat)
    and build your plug-in against the Acrobat product, following the documentation to make sure you only use API's that are available in the Reader program. The documentation tells you what version of the Adobe ACrobat or Reader program is needed for the function and whether the function can be called in Reader.
    Step two - Apply for a Reader certificate to allow your plug-in to be loaded by the Reader, the link is on the same web page as the above link. This step can be initiated before you have created your plug-in, and I would recommend that you do start this process before you develop your plug-in as Adobe can refuse to give you the certificate in which case all your development would be wasted.
    Only once you have permission form Adobe can you make your plug-in work with the reader application.
    Once you have done both these steps there are plenty of people on this forum that can help you with specific problems you may encounter.
    If you are not sure you have the knowledge to build the plug-in, there are plenty of people that you can hire to create the solution for you.
    HTH
    Malcolm

  • Is it possible not to allow the user to select radio button based on condi

    Hello All,
    I have two radio buttons ( Relation value 1 default , famid value 0 )
    can i create a situation where in the user cannnot select the famid radio based on some condition.
    The conditioin is that , the user should have selected atleast one item from three list controls then only i should allow the user to select famid radio else not ?
    thanks/kumar

    Hi,
    You can use javaScript to enable disable radio button. Call the javaScript from your select list onChange event.
    Hope this helps,
    Regards,
    Tajuddin
    web: http://tajuddin.whitepagesbd.com

  • If a User has select only on a table, it isn't listed in TABLES

    I have a group of Users I want to be able to access a view of the table (select only).
    I created a role and table/select privs. for those users. In SQL Developer they
    do not see a list under TABLES for those tables they have SELECT Access to.
    They can, however, enter a query (if they know the name) and select from the table,
    but they have to know the table name and they are not listed.
    Is there an Oracle priv. a user must have to have to view the TABLES (although they
    only have select)?

    Yes, I would think so. But for all the tables listed, when you click on the DATA tab you do not see any data. The only way to view is to go the SQL Worksheet and query *
    from the table.
    The user has SELECT on the tables.

  • Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    List and table controls -> listbox..is that what you are thinking of?
    The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
    If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
    MTO
    Attachments:
    Listbox_example.vi ‏34 KB

  • How to restrict the user to enter only numeric values in a input field

    How to restrict the user to enter only numeric values in a input field.
    For example,
    i have an input field in that i would like to enter
    only numeric values. no special characters,alphabets .
    reply ASAP

    Hi Venuthurupalli,
    As valery has said once you select the value to be of type integer,once you perform an action it will be validated and error message that non numeric characters are there will be shown. If you want to set additional constraints like max value, min value etc you can use simple types for it.
    On the project structure on left hand side under local dictionary ->datatypes->simple types create a simple type of type integer
    The attribute which you are binding to value property ;make its type as simple type which you made
    Hope this helps you
    Regards
    Rohit

  • File Open/Save dialog Restrict the user path selection Is there any way?

    Hello,
    Is there any way by which we can restrict the user from selecting the path from the Folder Browser/ File Open/ File Save dialog boxes?
    For example, I have a list of paths & want to allow the users to select from those paths or their sub folders. Is there any way to achieve this?
    Thanks!
    -Vinay Pugalia
    If a post answers your question, please click "Mark As Answer" on that post or
    "Vote as Helpful".
    Web : Inkey Solutions
    Blog : My Blog
    Email : Vinay Pugalia

    Hello Vinay Pugalia,
    >>For example, I have a list of paths & want to allow the users to select from those paths or their sub folders. Is there any way to achieve this?
    As far as I know, starting with Windows Vista, the Open and Save As common dialog boxes have been superseded by the
    Common Item Dialog:
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms646960%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    You could have a try to restrict the value of “look in”(shown in the opne dialog) and “Save in”(shpwn in the save dialog). If you want an example about the usage of this API, you could post a code sample request to:
    https://code.msdn.microsoft.com/site/requests
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • JFileChooser, how can you allow the user to select MORE than 1 file?

    Hello everyone.
    I want to allow the user to select multiple files from a directory, not just 1, but not just the whole directory.
    Currently I see these 2 options from looking at the sun's JFileChooser demo:
    //Create a file chooser
            fc = new JFileChooser();
            //Uncomment one of the following lines to try a different
            //file selection mode.  The first allows just directories
            //to be selected (and, at least in the Java look and feel,
            //shown).  The second allows both files and directories
            //to be selected.  If you leave these lines commented out,
            //then the default mode (FILES_ONLY) will be used.
            //fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);but both don't allow the selection of more than 1 file.
    When I say, select more than 1 file I mean the user can hold in SHIFT or CTRL and select files.
    Any ideas how to do this?
    Thanks!

    http://java.sun.com/javase/6/docs/api/javax/swing/JFileChooser.html#setMultiSelectionEnabled(boolean)
    Cheers,
    Laird

  • Forcing the user to select one of the OBIEE prompts?

    Hi All,
    Iam new to OBIEE I have a requirment in which I need to force the user to select one of the selection from prompts in OBIEE eg: you need to select one of the contry either India or America to get the other prompts enable and filter the report?
    Any help is highly appriciated.

    Hi,
    You can set a default value in your first dashboard prompt like 'please select a country' then if the user doesn't select something no result will be returned until he selects a valid value
    Then make the other dashboard prompts constrained.
    Regards
    Adil

  • Restricting the user to access only one view in or database

    A user wants to create a database link , so that he can view one of our views. We want to restrict permission, so that he can access only that view, and not any of our tables. What is the best way to proceed?
    Thanks in advance,
    Gayatri

    Pl do not post duplicate threads - Restricting the user to access only one view in or database

  • How to make a control to let the user to select a type of line?

    Dear All,
    I want to make a control to let the user can select a type of line from some types. Just like selecting the line type of plot in the graph.
    Is there any good way to do it, or is there any examples?
    Thank you.

    Hello,
    I think you can use a pict ring as selector and the detect value changes of that indicator to apply the new plot style on the graph using property nodes.
    Let me know if you need more help on this
    Message Edité par TiTou le 08-30-2006 01:50 PM
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    palette.jpg ‏19 KB

  • Can you ask the user to select a point?

    Is there a way in a javasript to ask the user to select a point and then get that information back as an X and Y value?
    Eric

    One way, if you have cs4, is have the user drop a color sampler. Then you could do something like this
    app.activeDocument.colorSamplers[0].position;// get the position
    app.activeDocument.colorSamplers[0].remove()// remove the sample

  • Restrict the user to select wrong wbs

    Dear Experts,
    I am creating a purchase requisition for project material by selecting account assignment category as Q. In the line item I am selecting plant for which the material is being procured. But if I select wrong wbs element ( wbs of other plant) then also system allows the P.R. to save. The same case is for creating P.O.as well as doing goods receipt and goods issue also.
    Please guide how the system should restrict the user to select wrong wbs while creating P.R. P.O. Goods Receipt and Goods Issue.
    Thanks & Regards,
    Aaditya

    Hi,
    Not sure but try checking these exits,
    SAPL2012 - Customer Exit for Enjoy Purchase Orders via BAPIs          
    SAPLMEWP - |Customer exit for processing of purchase orders via BAPIs  
    Hope it helps.
    Regards,
    Gokul

  • Is it possible for a saved path to open a folder where the user can select the file to open?

    I would like to retieve a link via database that would open a folder of drawings, word documents, pdf files, excel files etc., where the user can select which file they want. Selected files would open in which ever format they were with programs that are already installed on the users computer. For example, the link would open a folder where several solid works files were, and a couple of Word documents. The user would select one of the Solid Works files, and it would open up in the Solid Works installation on the users computer. Is this possible, or must a link point directly to a file?

    I'm not sure I understand what you mean by "link". Are you referring to a URL that uses a "file://" protocol?
    The standard File Dialog VI has a "start path" input that you can set so the file dialog opens to that folder.

Maybe you are looking for