Do you know if it's possible to change amount of items displayed in the combobox after it's been dropped down? (Something like a row count) Currently it shows only 8 items by default, and we all have huge screens and lot of items in the list, so it would be nice to show a larger combobox.
The property you're looking for is MaxDropDownItems.
Related
I am using a WPF DataGrid that is bound to a custom ItemsSource that implements IList (and NOT IEnumerable). The custom ItemsSource performs data virtualization and only loads pages of items as needed. MyDataGrid actually inherits from DataGrid and overrides the handling of the DataGrid sort methods so that I can maintain data virtualization while sorting. I have UI Virtualization turned on for MyDataGrid.
When I run the application, MyDataGrid displays just fine, tells me I have roughly 20,000 items, and only asks my ItemsSource for the first 20 or so items. I then can click on column headers to sort various columns and again my ItemsSource only has to reload the first page of 40 items because MyDataGrid has asked to refresh only the first 20 or so.
BUT, when I click on my Last Name column to sort, MyDataGrid loses its UI Virtualization and asks my ItemsSource to load every single item even though it only needs the first 20 or so. I can watch as it asks for every single item by index (this[0]).
I've tried researching ICollectionView, UI Virtualization, and Data Virtualization and the only thing that I've read that seems it may apply is regarding multiple row selection (at DataGrid row request patterns with data virtualization I've set MyDataGrid's SelectionMode to Single so this shouldn't apply.
Another hint may be that, prior to sorting by Last Name, the first item in MyDataGrid has a last name that starts with the letter V (very late in the alphabet), and that I can actually sort the list in Descending order by last name without losing virtualization. The same thing happens with my Title column which has a first item that starts with the letter S. I don't have the problem with any of the other columns.
Any ideas?
FIGURED IT OUT!!! Looking through the call stack, it appeared that the problem was happening during the MeasureOverride of the VirtualizingStackPanel and I noticed it was calling the SyncUniformSizeFlags method. So I then went into the default style for the DataGrid and set the RowHeight to a fixed amount and it no longer causes the problem.
So, it appears that the DataGrid can lose its virtualization when a fixed RowHeight is not set. Still don't know why opting to sort in ascending order by Last Name or Title caused it to want to resync the row heights, but I can work around that one.
I'd like to have a combobox where there is a lot of information in the list to select from or search but only parts of it are shown after selection.
For example when the user starts typing "raf" the combobox should show a list like this:
RA - Raffael (raffael#example.com)
HU - Hugo (hugo#rafferty.xyz)
After selecting the entry "Raffael" only "RA" should be shown in the combobox.
I need that because of the limited space for the combobox in my application. So the combobox should not be wider than needed to hold some characters but the list to select from may be much wider. Is there an easy way to achieve that? Or which function i have to overwrite in combobox to set the text line after the selection?
Thanks
This is not possible with a standard Vaadin ComboBox without custom client side coding.
I have a listview which have can say 80+ records and each record have 7 images. When i display whole records then it take too much time and also consuming memory.
I want to design wpf control, which display only records which can viewable on the page (suppose to be 6 records with assigned space). Suppose When user clicks on middle part of the scrollbar at position 50 then i have to show record from 45 to 50.
please help me by giving any sample tutorial,references or by code.
thanks
Ghacho
ListViews and DataGrids are virtualized (create controls only when visible) by default, you just need to use data-binding and data-templating instead of adding all the items manually (and thus forcing their creation).
I have a number of items which I wish to be contained in either a ListBox or an ItemsControl. The size of the control is fixed, but the size of its contents are not. It is possible for this control to have 13 items inside, but if the user wishes, only one is displayed at a time, and takes up the entirety of the available space. Two items visible roughly splits the available space in two and so-on.
I don't "require" selection, but I do require a context menu.
If I use a ListBox, I get almost everything I want EXCEPT that if I select an item on the far right, it will be centered and the view "jumps". I don't want this. However, if I use an itemscontrol, when the size of the items contained changes ItemsControl just draws completely wrong proportions (sets width to aprox 120% of what it should be if just one item were displayed).
Which control should I use? And I do I 'fix' it to do what I want?
We have a WPF app that has a master/detail window, both being WPF Datagrids. When you select a row in the upper datagrid, the details are shown in the lower datagrid. I was wondering if there are any best practices from a UI perspective on how to deal with things such as:
When the window first opens, no datarow is selected in the upper datagrid, and so no data can be displayed in the lower grid. Is this normal? Or is there typically an initial (top) row selected in the upper datagrid?
When a row is selected and then deleted - does another row become the selected row? Or are you going to go to a no row selected state?
If multiple rows can be selected, when happens in the lower datagrid? Show the last one selected? Or if delete is selected for these multiple objects, where is focus set? Or what row is selection?
I know there are a lot of different ways these things might be handled depending on how the app is written, but I wondered if there is some standard best practices? Or if there is some default operations for how the WPF datagrid might handle these cases?
thanks!
Bill
I think the first two considerations can come down to preference. I'd prefer to have the first row selected and its details shown when the window first opens -- this tells me, as a user, how this window works. Not sure how it works in WPF, but in Windows Forms, the datagridview pre-selected the top row by default (and getting it to stop doing that requires tricks).
When I remove a row, I personally prefer to go to a "no row selected" state, but I don't have much to back that up with in terms of "this is why you should do it". I just like seeing the empty "detail" view and lack of selection as confirmation that I did successfully remove the selected row.
The last point, however, I think is more clear-cut. If you have a master/detail relationship in views, you should not allow multiple selection. If you need the user to be able to perform actions on multiple rows of the master gridview, you can add some checkboxes to the rows to allow the user to pick a subset of rows to act on. But for the purposes of showing details, only one row must be selected at a time.