Hello,
to reproduce this behavior, you have to, for example, open the sample xamGrid/Editing & Selection/Selection from the samples browser (I use v16.1) and click inside the white empty area at the bottom. This will activate the first cell / row and set the ActiveItem property. Even, if you set everything to "select rows only".
Can I disable this "feature"? So, that a click inside the background doesn't have any effect.
Regards
Stefan
Hello Stefan,
Thank you for your update. I am glad that you now have an acceptable solution and behavior on your end that hides the active cell behavior.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Thank you for your assistance.
Of course, this is only useful for read only scenarios.
I now have a acceptable solution with a behavior, that provides me the selected item and a style, that hides the active cell.
If you were to completely disable the active-cell functionality in the XamGrid, I would imagine that you would have a hard time getting a cell to go into edit mode, as a cell being in edit mode requires that cell to be active and focused.
Still, if you are looking to prevent cell activation completely, on thing you could do is handle the ActiveCellChanging event of the XamGrid, which is cancellable by setting e.Cancel = true, or handle the ActiveCellChanged event and set the ActiveCell property of the XamGrid back to null inside. This should allow you to prevent the activation of the cells in the grid.
If you would like to see a property added to the grid in the future to make this cell activation behavior optional, I would recommend that you suggest a new product idea for it at http://ideas.infragistics.com. This product ideas site will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.
Hi,
I understand the way it works. And, of course, there will be an active item. But in my opinion, there must not be an active or focused cell, if I turn off every option of cell selection and cell click action. Maybe you could make this behavior optional in a future version to make this more consistent and easier to achieve.
In the XamGrid, there is almost always an ActiveItem as long as the grid is focused. Activated states work differently than selected states in the way that a cell or record can be active without being selected and vice versa. Essentially the "Active" item in the XamGrid will be the row or cell that is "focused" which will normally be the last one that you clicked. There can only ever be a single active item, as well.
In this case, if you are looking for data items, I would continue looking at the SelectedRowsCollection. Inside, you will find a full list of all of the Rows that are selected. Each of these Row objects have a Data property which will return the underlying selected data item. I would recommend that you use this instead of the ActiveItem property in the XamGrid if you are looking for a true, "selected" state of your data items.