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

How can we access static variable?

642


What is the adavantage of using ASP.NET routing?

640


How can we register exception filter from the action?

658


How may clustered index we can create in table?

557


Explain diff. Between friend and protected friend?

492






What is full form of asp.net?

508


What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?

657


Explain the use of view state?

552


What is asp.net? How is it different from asp?

538


What is difference between web api and web services?

531


What is asp.net mvc? : asp.net mvc

546


how to elimainte the similar data from the different tables

1701


What are the security types in asp.net?

572


Can we handle the error and redirect to some pages using web.config?

900


What is the difference between localization and globalization?

552