If I have a ListView embedded in a WinForm, is there any way I can simply click in the ListView and start typing in new items when the form is running?
At runtime, no. The only edit option it has is the LabelEdit property. Set it to true to allow the user to edit the ListViewItem.Text property of existing items.
In visual studio when you click on the listview a small triangle in the top right appears. When you click on it you can edit columns, etc.
Related
I'm designing an item template for a ListView but it is not shown on the designer.
I think that is because the ItemsSource is not set at the design-time, I set the ItemsSource at run-time only.
So is there a way to tell the designer emulate data for ItemsSource or whatever to show the preview?
Currently, I have to run the app to see the result or copy content of ItemTemplate to outside of ListView to see the preview then copy back later.
Guess I should have just put it as an answer.
In VS, right-click your ListView in the Document Outline and choose "Edit Template -> Edit Generated Items" or the same in Blend.
Then to toggle back out of there to your parent view hit the little icon in the top left corner of the document outline that looks like an upward pointing arrow on a bar
I have my own ContextMenu. I want to know that how can I disable Default Column Popup Menu for DevExpress XtraGrid control and show my own ContextMenu when user right-clicks on specified Column?
Check my answer to a similar question: How to add to the GRidViewColumnMenu Color und Font Editors
All you need to change is clearing the default Items collection, and instead of adding a new DXEditMenuItem, add one of these: DXMenuItem, DXCheckItem, etc., use which you need. But the idea is quite the same.
I have a ListBox in a Silverlight Application. I'm trying to make an editable listbox, so I use an ItemTemplate to have the controls i need in each item, like a textBox and buttons, and its working fine.
I'd like to have a line at the end of the Listbox with a button to add new items. Since this item won't be related to any of my domain classes, I'm using a plain object as a 'Filler', and then I have code that identify this item to show the button correctly.
myListBox.Items.add(new object());
The problem is that I want this "new Record" item to be kept always at the end of listbox, so when I need to insert a new domain record, i use this code:
myListBox.Items.Insert(myListBox.Items.Count - 1, domainItem);
When I debug the myListBox.Items collections, it is in the right order, with the "add new" button at the end, but the listbox is displaying this button at the beggining. Why are my items beeing displayed in a different order than the Items collection?
Unless there is a specific reason, instead of trying to put the button into the listbox collection itself you would be best to create a new control with the button outside and below the listbox. You can always style the button to look as though it's within the listbox if required.
Is there a reason why you are not using a datagrid because it would remove all your ordering problems and it would allow you to edit the entries.
The datagrid is bound to an ObservableCollection which automatically connects your editable fields to the GUI.
Cheers,
I'm trying to create a button in main window that would look like a globe, which would allow user to select his/her location. I want it to display a listBox when clicked on it just below the button itself.
Any hints on how to do this?
Probably the simplest way to do this is restyle a ComboBox and then restyle the ToggleButton in the ComboBox and remove the editable textbox.
This will avoid you having the implement the functions of the ComboBox for your popup.
Try using this as a starting point.
Another Approach would be to use the Expander Control with a list box in it
Link
OR
You could play with the Listbox's visibility property
I have a Silverlight form that contains a Stack Panel (orientation = vertical) with 10 rows. Each row contains a TextBlock and Textbox control except the last row has a TextBlock and Drowdown.. At the bottom of the control are two buttons. Previous & Continue.
There are 10 items in the Dropdown. When I select a value from the Dropdown, only two of the ten items are showing up. I believe that the remaining items aren't displying because there's some sort of clipping effect going on. Fair enough.
Does Silverlight allow the dropdown control to display upwards (instead of the default down direction)? Will I have to override some rendering capabiliities before the dropdown is rendered to the control or is there a property that allows me to accomplish this functionality?
The Silverlight ComboBox auto aligns the dropdown popup to always be visible whenever possible.
all Popup based controls (ComboBox, AutoCompleteBox, DatePicker and TimePicker) all have this feature enabled.
So if there's not enough screen real-estate below the ComboBox to show the dropdown popup, it'll show up above the control.
The combobox nesting in the visual tree should not affect the dropdown popup auto alignment. The internal Popup control (inside the ComboBox) ignores the Visual Tree and is nested "above" the visual tree.
If you have specific issues, please share minimal and relevant XAML. Since Keith is on this thread, I think it's safe to say he'll log a bug if needed.