I am testing the demo version of the GridView control (Q2 2011 version) and by integrating it into my current project. I am running into an issue though, because my current implementation makes heavy use of TypeConverters to display data in WPF controls. To help explain my question, lets assume a couple of things:
First, we have a generic superclass called Super, which has a property that is an ObservableCollection<Super> which is called Stuff.
In another assembly, we have some generated code that defines subclasses of Super, each with their own set of properties. Some of the properties of this subclass have custom type converters also defined in the same file (these type converters are automatically generated). For example:
I abbreviated some of the methods but assume that they convert Int64s to Strings and vice-versa.
In addition, these subclasses fill the Stuff collection with some elements. Now, in my application we only refer to these subclasses by loading the assembly programmatically and using reflection.
When we pop up a GridView and bind it to the Stuff collection like so:
We get what we wanted to see, all the properties of the subclass are reflected on and columns are automatically generated for them. We can edit them and ones that were not Browsable don't show up, ones that are ReadOnly can't be edited, etc. The only downside is that our custom type converters do not appear to work, and in fact it seems that they are never called by the GridView. We know that the TypeConverter code does work, as we have used them with other WPF controls for quite some time now without issue.
We are willing to change the way we define our TypeConverters if necessary (given that the WPF PropertyGrid that you provide would also support the TypeConverters given the same change), but we can not feasibly change to using IValueConverters, as that only provides us with ConvertTo and ConvertFrom methods, and what we really want is to be able to use the StandardValuesCollection (or something similar) that TypeConverter provides us, to avoid writing a lot of extra code in order to handle this conversion ourselves.
I saw a thread that somewhat pertained to this issue here, which claimed that TypeConverter support was added in the latest release but the author never wrote back to confirm if the changes worked for him or not. Please let me know what steps we should take to solve this issue. We are very interested in purchasing your product because everything else about the GridView seems to work perfectly for us, but this is a problem which must be solved. Thanks in advance.
First, we have a generic superclass called Super, which has a property that is an ObservableCollection<Super> which is called Stuff.
In another assembly, we have some generated code that defines subclasses of Super, each with their own set of properties. Some of the properties of this subclass have custom type converters also defined in the same file (these type converters are automatically generated). For example:
public
class
Person : Thing
{
[Browsable(
true
)]
[TypeConverterAttribute(
typeof
(JobIDTypeConverter))
public
Int64 JobID
{
get
;
set
;
}
private
class
JobIDTypeConverter : TypeConverter
{
public
override
bool
GetStandardValuesSupported(ITypeDescriptorContext context)
{
return
true
;
}
public
override
StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
//jobIDDisplayNames is an array of strings
return
new
StandardValesCollection(jobIDDisplayNames);
}
public
override
CanConvertFrom(...) { ... }
public
override
ConvertTo(...) { ... }
public
override
ConvertFrom(...) { ... }
}
}
I abbreviated some of the methods but assume that they convert Int64s to Strings and vice-versa.
In addition, these subclasses fill the Stuff collection with some elements. Now, in my application we only refer to these subclasses by loading the assembly programmatically and using reflection.
When we pop up a GridView and bind it to the Stuff collection like so:
RadGridView grid =
new
RadGridView();
grid.ItemsSource = mySuper.Stuff;
We are willing to change the way we define our TypeConverters if necessary (given that the WPF PropertyGrid that you provide would also support the TypeConverters given the same change), but we can not feasibly change to using IValueConverters, as that only provides us with ConvertTo and ConvertFrom methods, and what we really want is to be able to use the StandardValuesCollection (or something similar) that TypeConverter provides us, to avoid writing a lot of extra code in order to handle this conversion ourselves.
I saw a thread that somewhat pertained to this issue here, which claimed that TypeConverter support was added in the latest release but the author never wrote back to confirm if the changes worked for him or not. Please let me know what steps we should take to solve this issue. We are very interested in purchasing your product because everything else about the GridView seems to work perfectly for us, but this is a problem which must be solved. Thanks in advance.