Suppose you display a data having 200 records in a
datagrid. Then you edit 100 records of them. Now when you
will press update button,all 100 records should be updated
in single shot rather than reading every record and
updating. How to do it?

Answer Posted / guest

Here, bind primary key of database to datagrid column make
it visible false.
and travel loop as

foreach(DataGridItem dataItem in DataGrid1.Items)
{
priceText = (TextBox)dataItem.FindControl
("txtBookPrice");
bookIdText = (TextBox)dataItem.FindControl("txtBookId");

Updatecode_for_perticular_row ();

}

txtBookPrice= textbox from witch u would like to update
txtBookId= test i.e. unique id comming from database

With help of unique id in for loop find perticular text in
texbox and update.

This code you will write on update button click.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define a multilingual website?

537


How can we inherit a static variable?

548


Can we set master page as a start page?

549


What is the function of the ViewState property?

647


Where web.config file is used?

576






Explain the use of duration attribute of @outputcache page directive.

626


What is Razor View Engine

610


Explain client side state management system.

571


What is advantage of code behind coding in ASP.NET?

563


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net?

528


Explain transparent caching with aop?

527


Explain the asp.net session state modes.

622


What are the disadvantages of using session?

477


Is there any property names “isnavigating”?

581


What is web api and why to use it?

563