Binding to a struct

Hello,

I have noticed if I use a custom struct instead of a class as a data source for a binding source I cannot get the changes back ( if I write (CustomStruct)customStructBindingSource.DataSource I'm getting a struct with no changed values ).
I presume this is because for structs, asignment makes a copy so any changes in one struct is not visible in the other.
Anyway, I wanted to ask if this is the desired behaviour or a bug. If this is how it is supposed to work, I have to change the struct in a class.

Thank you,
Valentin Iliescu

[556 byte] By [viliescu] at [2008-2-20]
# 1
You are correct and this is by design. Structs are ValueTypes and are copied by Value.

Joe

JoeStegman at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...