I have created a custom editor for GridView (based on BaseGridEditor).
The nature of my editor is that the "Value" you select in the editor is actually two values (integers), there is also a text description I would like to be displayed in the grid when the cell is not edited.
I tried to make the editor expose an object of a class encapsulating my two values and the text description with the Value property. (The class had a ToString implementation that returned the text description).
I also tried to bind the grid to something like
Grid.DataSource = from s in whateversource select new {irrelevantfield = "whatever", complexfield = new ComplexClass { v1=o.v1, v2=o.v2, description=o.Description}};
However, the grid doesn't seem to want to remember my ComplexClass value, it seems it just runs ToString on what it gets from the editors Value property, because when I edit the cell again it sets the editors Value property to a string.
Can you recommend a way to
1. handle the selected "value" and text representation separately.
2. handle selected "values" that are complex, that is they are multiple values.
Thanks
The nature of my editor is that the "Value" you select in the editor is actually two values (integers), there is also a text description I would like to be displayed in the grid when the cell is not edited.
I tried to make the editor expose an object of a class encapsulating my two values and the text description with the Value property. (The class had a ToString implementation that returned the text description).
I also tried to bind the grid to something like
Grid.DataSource = from s in whateversource select new {irrelevantfield = "whatever", complexfield = new ComplexClass { v1=o.v1, v2=o.v2, description=o.Description}};
However, the grid doesn't seem to want to remember my ComplexClass value, it seems it just runs ToString on what it gets from the editors Value property, because when I edit the cell again it sets the editors Value property to a string.
Can you recommend a way to
1. handle the selected "value" and text representation separately.
2. handle selected "values" that are complex, that is they are multiple values.
Thanks