T
Tom Jorgenson
I have a DropDownList whose items are populated simply via the Items
property of the control. The field represents the gender of a client and the
items are simply 'Male', 'Female', and 'Choose One'.
I want to bind the selected item to a table record where the field is a text
field, that is, I want the stored field to be (for example) 'Male' rather
than a foreign key or index value. The field has a default value of 'Choose
One'.
This would seem to be straight-forward enough. I would think that I should
simply bind the SelectedValue property to the specified table field. But it
doesn't work. Specifically...
When the DataBind() method is called an ArgumentOutOfRangeException error is
generated. I thought this might be due to the width of the data field (15
characters), which causes the stored value to be padded with spaces (i.e.
'Choose One ' rather than 'Choose One') so I simply tried to change the
Items property to hold items padded out similarly (figuring I'd try to find
a way to trim the field via the Format later). No change.
What am I doing wrong?
Thanks!
property of the control. The field represents the gender of a client and the
items are simply 'Male', 'Female', and 'Choose One'.
I want to bind the selected item to a table record where the field is a text
field, that is, I want the stored field to be (for example) 'Male' rather
than a foreign key or index value. The field has a default value of 'Choose
One'.
This would seem to be straight-forward enough. I would think that I should
simply bind the SelectedValue property to the specified table field. But it
doesn't work. Specifically...
When the DataBind() method is called an ArgumentOutOfRangeException error is
generated. I thought this might be due to the width of the data field (15
characters), which causes the stored value to be padded with spaces (i.e.
'Choose One ' rather than 'Choose One') so I simply tried to change the
Items property to hold items padded out similarly (figuring I'd try to find
a way to trim the field via the Format later). No change.
What am I doing wrong?
Thanks!