I have text column in grid that shows date. I cannot use datecolumn, because sql field set as text. How can I show date picker when user click on cell?
thanks
Ah,
Thats probably it. There were definitely fixes made in that area, since the 10.2 release.
You should get the latest SR.
-SteveZ
I already thought that it might be my custom implementation, so I tried the unmodified DateColumn before my last post and it works exactly the same. I am on the release version of 10.2 if that helps.
Hi Bob,
I wasn't able to reproduce the issue.
Here is my custom DateColumn and ContentProvider:
public class CustomDateColumn : DateColumn
{ protected override ColumnContentProviderBase GenerateContentProvider() { return new CustomDateColumnContentProvider(); } } public class CustomDateColumnContentProvider : DateColumnContentProvider { TextBlock _tb = new TextBlock(); public override FrameworkElement ResolveDisplayElement(Cell cell, Binding cellBinding) { this._tb.SetBinding(TextBlock.TextProperty, cellBinding); return this._tb; } }
Steve,
I thought this solved all my issues, but I still have one. The date now updates when you are entering the date in the textbox portion of the DatePicker and it loses focus to another cell by tabbing or clicking. The problem is that the date does not update if you loose focus to a control outside of the xamGrid. If I click on a textbox or button that is not part of the grid, then the date in the cell goes back to the previous value. I looked at the cell during the CellExitingEditMode and the grid LostFocus events, and it just doesn't have the changed date. Is there a place I can force the binding to update?
Bob
Thanks Steve, I will give that a try.