DG Start wtih Row 0 in Edit Mode?

S

Scott Murray

My "Add a Record" button is outside of the DG.

When it's pushed, it adds a new row at the top of the DG. It add the row in
normal display mode, forcing the user to hit the Edit Button to enter data.

I'd rather have the DG display the new row already in Edit mode (with
Textboxes).

I've experimented with putting:

dg_line_items.EditItemIndex = 0

in different places, but have not succeeded.

Any ideas?

TIA,
Scott Murray
 
J

JLeary

Not sure if this is related, but I am trying to do something similar. My
'Add' button works fine if there are already rows in the datagrid, but if it
is the first, it is failing. I was trying to code functionality to auto
populate the first row of the grid if the datasource had zero records.
 
S

Scott Murray

My DG works fine, it's just a convenience for the user to have the new row
already in edit mode.

When I try to set the EditItemIndex = 0, I get an Failed to load viewstate
error.
 
S

Scott Murray

I was not performing a dg.databind after setting the EditItemIndex = 0.

sorry...i learned to read in the first grade but sometimes forget to do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top