I am displaying a database table on a grid view and displaying a selected item's details in a detailsview.
Here's the problem:
There's a combobox in the detailsview and I want to display the added value's string on grid and I want the combobox to select this value.
It will be possible to update, delete the selected item from grid or add a new item. And I couldn't do the transformations of string- comboboxitem-database item. And I am quite confused on the binding operations. I hope my question is clear enough. Thanks in advance for any help.
One solution that may preserve your sanity. Only allow edits in your detailsView. Use the grid to Add (clicking an Add Link which shows the detailsView) or Delete. Is it really necessary for the user to be able to edit in either place?
Related
I need to edit the values of an existing ListView row (i.e change the values of an Item and its Subitems).
I need to do that programmatically and not by clicking on the ListView item at runtime to rename it.
just use LVM_SETITEM as documented.
I have a silverlight DataGrid, by default on page load the all the cells of the datagrid should be Readonly. I have 2 problem , can any one help me?
1.On Click on the RowHeader the current row should be editable
2. On click of the columnHearder current column of all row should be editable
This might not solve your entire problem but it should partially address it.
This is to make a column read-only in a datagrid
DataGrid.Columns[7].IsReadOnly = true;
Obviously the property can be changed from events but the data grid does not have row/column headers event handlers. Custom controls seem the way to go without introducing any new gui elements like buttons and changing the feel of the application.
I'm adding image items to a ComboBox, as you know ComboBox shows just one item in a row, but I want my combo to show more than one, and show images like they are all beside each other with a little space around them, so the user can pick one...
Any Help is pretty much appreciated...
You need to change the ComboBox.ItemsPanel to a WrapPanel.
You would have to edit the ItemTemplate and the ItemsPanel.
Right click the combobox and select Edit Aditional Template --> Edit Generated Items --> Create Empty
Add an image and a text to a Vertical StackPanel in the template and set the bindings.
Now leave the template editing and right click the combobox again.
This time go to Edit Aditional Template --> Edit Layout of Items --> Edit a Copy
Change the StackPanel to a UniformGrid and set the Columns property of this to 2.
The result should look a little like this:
I used sample data in this example. 2 properties: one image, one String(Name).
I'm wondering if I can make fake sections in the popup menu:
The rule would be, if the 5th character of the displayed item is different from the 5th char of the previous item in the menu, it has to be highlighted
What do you think?
Thanks!
To achieve this would be a hack.
Normally the items that appear in the popup part of a combo box will be an instantiated data template, and each gets its own data item and has no clue or knowledge of the other items in the list, so you couldn't use a converter or anything else to achieve this behavior.
What you could do though is inject (attach) your own control into the popup part of the combo box, and take over the rendering of the data items. How you do this will depend upon which combo box you are using (i.e. MS or some other vendor's) and would be a whole new question.
Would that be easier if I were to create my own combobox as follow:
a TextBox associated with a Button that when pushed would popup a datagrid in which I could implement this conditional formatting?
When I selected some item in combobox and then I'm trying to select another item in same combobox, I can see only one item - those which is selected right now. I believe that happens because of autocompletion. Does anybody know how I can disable it or something. I need to see all values on each click, regardless if something was selected already or not.
Add triggerAction:'all' to your config.
better add disableKeyFilter:'true' to your combo box