Hi,
We're developing a fairly complex ui using the XamDataGrid and are encountering the following 2 problems that no amount of research and trial and error will resolve:
1. We're implementing copy/paste and when selecting the cells for copying get the following odd behavior: placing the mouse cursor over a cell that contains date/time data, depressing the left mouse button and dragging over other cells does select the appropriate cells as expected. However if you try to start the copy operation (press and hold left mouse button) over a cell that doesn't have a date (i.e. the underlying date property is null) cause the cell to go into edit mode and drops down the calendar. How do I get around this inconsistency?
2. Cells with null dates display a "//" in the cell. We need it to be blank until the user enters edit mode but setting the NullText property to the empty string doesn't do anything. How do I get the cell to be empty?
Enclosed is a severely stripped down version of the code that demonstrates both issues.
Any help you can provide will be appreciated.
Thanks!
Glenn Les
Hello,
I am glad that you have solved your issue.
If you have any other questions on this matter, feel free to ask.
I never received any notification of Elena's reply.
I figured out a way to get the cell selection consistent myself: the cell selection appears to be triggered by left mouse down on the embedded textblock (SimpleTextBlock) when the cell is not in edit mode. When the textblock's content is null the width is zero so there was nothing to catch the left mouse down. I solved it by setting the HorizontalAlignment of the textblock to stretch and using the Margin to size it over the white area but not over the drop down button.
You can close this item.
Thanks
Glenn
Hello Glenn,
We are still following this forum thread.
If you have any other questions or concerns about this matter please do not hesitate to contact us.
I have been looking into your issue and I am not able to reproduce the scenario that you are describing on my side. I created a small sample where I placed XamDataGrid bound to both null and not null DateTime and on my side their cells behave similarly when you click over them. Would you please take a look at the attached sample and modify it in order to represent your scenario so I can continue my research over it.
Thanks in advance.
Thanks Yanko but I still don't see how that fixes issue #1. Howeve, rusing your sample's xaml I've reworked the templates and now have that behavior working as needed.
However issue #2 is still open: why is there inconsistent multiple cell selection behavior between a cell (xamDateTimeEditor) that has data versus one that doesn't have data when initiating multi-select using the left mouse button. As an alternative, how would I multi-select cells using the left mouse button plus the Ctrl key??
Thanks,