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
240
how can i do this?
posted

i using XamDataGrid. and then i had bind the data collectiion(ObservableCollection<MyData>) to the XamDataGrid.

structure of the data is allow below

public class Mydata

{

    public byte _no;

    public bool _enable;

    public byte _when;

    public byte[ _whenInfo;

    public byte _action;

    public byte[ _actionInfo;

}

i don't want to hierarchial display. and the _whenInfo filed is used within the _when field. for example, if a value of the _when field is 1,

First byte value of _wheninfo is Hour, Second byte value of _wheninfo is Minute. the rest bytes is not used. so _wheninfo field display "12:30"

if a value of the _when field is 2, values of _wheninfo is Year, Month, Day, Hour, Minute, so _wheninfo field display "2008/09/23 12:30"

 

how can i do this??

  • 6867
    posted

    I suggest you build an adapter class that takes a Mydata object and transforms its values into something more typical.  For example, get rid of all the byte[ and replace them with DateTime properties.  You'll find it is much easier to show that data in the grid than what you've presented above.  Alternatively, you could build a bunch of value converters that perform the data transformations, and specify them in the Field.Converter properties, but I think re-shaping the data source is a better option in this scenario.

    Josh