OK, I expect this is a noob data binding question but after days searching
the msdn forums, google and my form books for an answer, I hope someone here
can explain to me what I’m doing wrong.
I have a custom class called Location, which has Latitude and Longitude
properties. These values are saved in double radians. I’ve created a user
control which displays the lat/lon in several formats (decimal degrees,
degrees/minutes/seconds, UTM). None of these formats reflect the underlying
data type of Location. In the user control I have a text box which displays
the value and a combo box to pick the units. Following the pattern I saw in
DateTimePicker I made a property of the control called Value which is the
Location associated with the control. You use the get of Value to retrieve
the value and set will initialize the text box via code. This all works
great but I cannot bind a Location object to the Value property of the user
control.
So, question 1, what steps do I have to follow to make a data bound user
control which binds to a custom class.
What makes this problem more interesting is that I want to embed the control
as a column in a datagrid. I have the cell and column and Editing control
all working. But after I enter a value in the editing control, the Location
is not being pushed back to the data grid. I suspect this is due to the
problem I’ve listed above.
Bryan Phillips - 05 Apr 2007 02:25 GMT
Try reproducing the problem by added the user control to a form. If the
problem still occurs, it is a binding problem. Otherwise, the
DataGridView could be the problem.
--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net
> OK, I expect this is a noob data binding question but after days searching
> the msdn forums, google and my form books for an answer, I hope someone here
[quoted text clipped - 20 lines]
> is not being pushed back to the data grid. I suspect this is due to the
> problem I've listed above.