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
110
UltraDataRow.Tag property is not deserialized after excecute UltraDataSource.LoadFromXml() method
posted

 

My application uses Tag property to store the data (with customize type) in each row. Every time the form (that contains the UltraGrid) is loaded, it creates UltraDataSource that each its UltraDataRow has Tag property assigned with. If the property is not filled with the data the grid would show nothing (there's no row in the grid).

In other words, UltraDataRow.Tag property has to be filled with the data. 

Foo foo = GetDataFooFromSomewhere();

object[] cellValues = GetCellValuesFromFoo(foo);

UltraDataSource dataSource = new UltraDataSource();

UltraDataRow row = dataSource.Rows.Add(cellValues);

row.Tag = foo;

UltraGrid grid = new UltraGrid();

grid.DataSource = dataSource();

And whenever users change the value in the grid, in AfterCellUpdate(), foo instance is extracted from UltraGridRow and is updated. So filling the Tag property is crucial.

Problem arise when excecuting UltraDataSource.LoadFromXml(). The loaded UltraDataRow.Tag property simply is null. But when i see the xml file, there's Tag xml tag:

<!-- other xml data -->

<a2:UltraDataRow id="ref-9" xmlns:a2="http://schemas.microsoft.com/clr/nsassem/Infragistics.Win.UltraWinDataSource/Infragistics2.Win.UltraWinDataSource.v8.3">

<!-- other xml data -->

<!-- the Tag is saved in this xml file but cannot be loaded again -->

<Tag xsi:type="a3:ObjectWrapper" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Infragistics.Shared.Serialization/Infragistics2.Shared.v8.3">

<objectValue href="#ref-18"/>

</Tag>

</a2:UltraDataRow>

<!-- other xml data -->

<a4:Foo id="ref-18" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/FooProject">
<FooName id="ref-25">wowowo</FooName>
</a4:Foo>

<!-- other xml data -->

Why is that happen? It saves the Tag property to the xml file, but cannot be loaded again. Could i missed something here? Please help. 
Btw FYI, the Foo class already has Serializable attibute and implement ISerializable interface. 
Parents Reply Children
No Data