This is a migrated thread and some comments may be shown as answers.

Inheriting GridViewDataColumn

3 Answers 26 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Matt Bohn
Top achievements
Rank 1
Matt Bohn asked on 21 Apr 2010, 03:42 PM
I'm trying to inherit from GridViewDataColumn to create a column type called GridViewShortDateColumn so that a format string or converter doesn't have to be specified every time.

I've tried this

 public class GridViewShortDateColumn : GridViewDataColumn 
    { 
        public GridViewShortDateColumn() 
        : base() 
        { 
 
            this.DataFormatString = "{0:MM/dd/yyyy}"
        } 
 
    } 


But the format string doesn't have any effect.

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 22 Apr 2010, 08:41 AM
Hi,

Just checked this using our latest official version Q1 2010 and everything worked as expected. You can check the attached example application for reference.

Sincerely yours,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Matt Bohn
Top achievements
Rank 1
answered on 27 Apr 2010, 04:04 PM
It works to display the data initially, but the cell isn't updated if the underlying property on the object is update.  The underlying object is using INotifyPropertyChanged to notify when a property changes, but  using the inherited column the cell doesn't update when the object does.   It works as long as I use GridViewDataColumn with the DataFormat String in XAML.

Any ideas?
0
Vlad
Telerik team
answered on 29 Apr 2010, 07:27 AM
Hi,

Everything worked as excepted for me. Please check the attached application.

Kind regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Matt Bohn
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Matt Bohn
Top achievements
Rank 1
Share this question
or