Placement of context menu on devex grid control - wpf

I am using a devexpress grid control to display a grid. The grid shows a context menu. When i right click on a row, the menu is shown but only when the row is a newly added row. It means the menu is visible only on some rows so i have bound its visibility with a property on view model. The problem is if i right click on a row which doesn't show a context menu and then right click on the row which shows the context menu, the menu becomes visible on the last clicked row(the one which doesn't show context). Any help with this?

Related

wpf custom combobox with datagrid but after popup dorpdown the first item is not selected

i have customed a wpf combobox with a datagrid in it.
After you click the toggle button of the combobox, it will open the dropdown popup and show the datagrid like the image below.
cilck the toggle buttom to show the whole result
Now my question is why the first item in the datagrid in the dropdown popup is not selected?And if after i press the down arrow key, it will select the second(like the image below press the down arrow key right after the dropdown shows) item which makes me fell that the first item is somehow selected but the highlight background is not shown.
Is this about the focus or anything else? Really no idea here , Thanks in advance.

Weird grid behavior ( must click scroll bar )

I'm programming an application that loads a list of rows in a grid using WPF, DevExpress with an MVVM approach.
I have a button that adds an new element to a ListRow, which is binded to GridControl's ItemSource. This list notifies the view when it's modified.
The problem is that when you click NewRow button the scroll bar grows bigger with each click but only when you click in the scroll bar the content of the list is repainted in the window.
Does anyone have any idea? Why is this happening?
PS: I didn't write here any code because I think is needless to show such a long code. But I can put it if you want.

How to make the listbox rows not able to be selected?

The image above depicts a ListBox. You can see the rows are able to be selected. However they should be not selectable when i click on the row, but i have no idea on how to solve this problem.
My question is, how to make the listbox rows above not able to be selected?
The easiest solution would be to use an ItemsControl instead of a ListBox. It's a similar control that doesn't allow selection.
You can retemplate the control, removing the selected state animation. Easy to do if you have Blend.
Right click on the ListBox, select Edit Additional Templates | Edit Generated Item Container | Edit A Copy. Switch to the States tab and choose the Selected state. (For Silverlight) you should see that the Rectangle "fillColor2" has a red circle, showing it's Opacity property is animated in this state. Expand fillColor2, click Opacity, and press delete. You can also do the same for the Focused state (and MouseOver state, if you don't want a mouseover effect)

WPF: Context Menu dissapears after item update in my GridView

so, I have this ListView in grid mode. I am dynamically updating it using a CollectionView. now, the problem I have is that when I open a context menu by right clicking on an item in my grid the context menu closes after the item updates--now, it is not a new item but it is the same item. Does anyone have any ideas on how I can make the contet menu stay open after the item updates?
[Edit]
The grid is part of a public safety application that updates in near real-time. so the items are periodically added, removed, and updated. If we right-click on an item to open the context menu and an update occurs before I can close it--even if the particular item does not change in any way--the context menu closes. The desired behavior is for the context menu to remain open.
If you could supply your XAML that would help, but my guess is that you have defined the context menu on the ListViewItem element and that the menu closes because the whole ListViewItem is regenerated or replaced by WPF.
Perhaps you can define the context menu on the ListView instead? You will have to update your commands and get the selected item from the list when executing, since the context will no longer be a specific item.

Silverlight: Tabbing in DataGrid

I have a DataGrid with four rows and a few columns. Only the last column has an item (a button) with IsTabStop=True.
If I press tab the button in the first row gets the focus.
If I hit tab a second time the next control outside the grid gets the focus.
If I then hit shift-tab the button in the last row gets the focus.
Is there a way to make the DataGrid work like other controls and just tab normally through the four buttons?
For the focus to remain within the DataGrid, the current cell needs to be in edit mode.
http://msdn.microsoft.com/en-us/library/cc838112(v=vs.95).aspx

Resources