Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
xamGrid DateColumn
posted

Hi, I am using a xamGrid in Silverlight.

I am using auto-generate columns.

One of my columns is a DateColumn, its data source is .Net DateTime object.

There are 2 problems -

1)

The column displays correctly at first with little calendars in each cell of the date column.

But if you scroll the grid the date displayed on each calendar loses its value and gets displayed as D/MM/yy.

2)

How do I format the date column? All of the samples I could find on the web refered to TextColumn and FormatString which is not available for DateColumn.

I don't want to convert to text as I want to use a filter on the column and this won't work if the column is treated as text.

Kind Regards, David.

Parents
  • 6475
    Suggested Answer
    posted

    Hi,

    I believe your first issue is a bug in the control that was fixed a while ago. Upgrading to the latest SR should fix the problem.

     

    As for the second one, you can set an EditorStyle on the column and set the SelectedDateFormat property of the date picker in this style:

    <Style x:Key="LongDateStyle"
            TargetType="sdk:DatePicker">
        <Setter Property="SelectedDateFormat"
                Value="Long" />
    </Style>
    <ig:XamGrid>           
        <ig:XamGrid.Columns>
            <ig:DateColumn Key="LongDateTime"
                        EditorStyle="{StaticResource LongDateStyle}" />
        </ig:XamGrid.Columns>            
    </ig:XamGrid>

     

    In 11.1, we're adding the SelectedDateFormat property on the DateColumn, which should make this easier.

     

    Hope this helps,

Reply Children