Is there a way to make Tab and Enter both commit the currently selected value?
Thanks,
Jon
Hi Jon,
Maybe it's because we are using different versions of the Infragistics DLLs but when I tested this against the latest 14.2 WPF DLLs I was not able to reproduce this. In my sample if I start typing values into the combo editor text box, it filters the dropdown values as expected. If I then press the Tab key to move focus away from the combo editor and into a different control, I can see that the first value in the filtered dropdown is selected. Both the SelectedItem and SelectedValue (assuming I set SelectedValuePath) properties have updated. I have attached my sample. Are my steps wrong? Or are you using an older version? If so can you tell me what the exact version # is of the DLLs you are using?
Sorry I didn't give more information. I am on 14.2.
The issue is only if I have CustomValueEnteredAction="Allow". I would like tab in some cases to commit the selected record.
Thanks.
Thanks for the clarification. When I set CustomValueEnteredAction to Allow I was able to see the behavior you talked about. In order to get the Tab key to select the first item you can do something like what is described here: http://www.infragistics.com/community/forums/t/79962.aspx
I have attached a modified version of my sample to demonstrate this in action.
A related question.
Instead of just choosing the first item, is there a way to choose the currently highlighted item? Or at least the first item not filtered out?
When you set the SelectedIndex, the index provided should be the index for the item you want selected in the current list of dropdown items. If you look at the sample in my previous update you can see that there are 3 items in the drop down when no value is typed into the textbox, Joe, Mary and Jim. If I type in "M" then I see that Mary is the only option that appears in the dropdown. Pressing Tab then selects Mary even though I set the SelectedIndex to 0. If it didn't select from only the available items in the dropdown then Joe should have been selected as he appears before Mary in the ItemsSource.
My requirements have changed a little bit. I now have CustomValueEnteredAction="Add".
I need to commit any value typed in as well. How do I allow the typed value to be added on events other than Enter. I need it to work on tab (not just selected item, but newly typed value) and also upon lose focus.
I am in a XamDataGrid, so I have tried DataPresenterCommands.EndEditModeAndCommitRecord both in editmodeending and also in XamMultiColumnComboEditor DropDownClosing, but it appears that the value has already been cleared.
Any ideas?
Sorry to push on this, but I have a tight deadline on this issue.
I set the CustomValueEnteredAction to "Add" but when I type in a value that doesn't exist in the data and press the tab key, that value not only gets added but it is also selected. So this appears to already support your requirement. You should be able to see this in my sample. You will have to comment out the PreviewKeyDown stuff in order to run it with CustomValueEnteredAction="Add" but you will see that typing in a value and pressing the tab key causes the value to be added and selected.
If you do not see this behavior then please let me know what the exact version # is for the Infragistics DLLs that you are using so I can test that version. It will look like this: 14.2.20142.****.
My DLLs are 14.2.20142.1000.
Here is a link to my files:
http://1drv.ms/1xCAxkk
I have attached a screen video of what I'm trying to do with a sample project.
In the Attribute 1 column, I type in 1.5 and click Enter. Value is committed as expected.
In the Attribute 2 column, I type in 1.5 and click Tab. Value is lost.
In the Attribute 3 column, I type in 1.5 and click outside the cell. Value is lost.
These are the scenarios I need to have the value committed.
Also, as you can see from the video, there is a secondary issue with the popup. As I'm typing sometimes the footer does not render properly. You see the blue line that shows up. All I'm doing is showing the footer only when all items have been filtered out.
Let me know if you have any more questions for me. Thank you so much for your time.