Save GridView once?



I have a small GridView about max 10 rows and few columns. The columns are
simple just a checkbox and a textbox and a bound name.

The users don’t want to click “edit†button to edit and save each row one by
one. They want to edit multiple rows and save once.

I try to put checkbox and textbox in ItemTemplate, and the UI looks OK on
client site. I can select checkbox and type chars in textbox. But when I try
to save them through GridView.Rows after posting back, the checkbox and
textbox states are not post back or updated.

I think, the textbox value should be posted back because it was renderd as
<INPUT> control. Maybe, the ASP.NET engine doesn’t update textbox object when
it re-construct textbox objevt at server side.

Is there a way to retreviel the textbox value by implementing a event
handler, or set a property? The textbox client id is wiered at GridView rows,
and only Microsoft know the convension and I don’t.

Short question is:

Is there any way to save all row once, not row by row?

I know repeater does. But making repeater look like a Gridview is paintful.

Thanks for any help.





Sorry, it’s my mistake. I put GridView binding routine out of “IsPostBackâ€
bracket at Page_Load procedure, and GridView binding routine gets called
evrytime before saving event handler routine after postback. The binding
routine wraps off all changes users entered.

Actually, you can retrievel all current GridView data row by row through
rows property and save them once.


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