views:

1314

answers:

4

I have a web form with a button and a DetailsView control on it. In the button's click event I change the DetailsView control to insert mode so I can add records:

DetailsView1.ChangeMode(DetailsViewMode.Insert)

Everything works fine, except for a checkbox in the DetailsView. When the DetailsView goes into insert mode, the text describing what the checkbox is for disappears. The checkbox itself works fine.

Why is my text disappearing and how can I fix it?

+1  A: 

Is the text in a Label that is in the item template? If so, you'd need to add it to the Edit Item Template. Also check that the width of the control is wide enough for all the controls and text. It may be getting hidden due to absolute positioning.

Nikki9696
+1  A: 

Thanks for the quick reply. The text isn't in a template. It's just a CheckBoxField with the Text property set to "Active":

I've tried widening the field and the DetailsView control, but the text still disappears when I click the button.

Slapout
+2  A: 

I was able to fix my problem by changing it to a template field. Not sure why it wouldn't work the other way.

Slapout
A: 

(Deleted by poster)