Results 1 to 3 of 3

Thread: Update datagrid

  1. #1
    BarnesHarris is offline Senior Member
    Join Date
    Dec 2009
    Posts
    213
    Rep Power
    4

    Default Update datagrid

    I want to display a data having 300 records in a datagrid. Then you edit 50 records of them. When you will click update button, all 50 records should be updated in single click before reading every record and updating. It is possible? If you have any useful code then let me know that..

  2. #2
    HowardAllen is offline Senior Member
    Join Date
    Dec 2009
    Posts
    196
    Rep Power
    4

    Default

    This code you will write on update button click.

    First off all bind primary key of database to datagrid column make it visible false and travel loop as

    Code:
    foreach(DataGridItem dataItem in DataGrid1.Items) 
    {
          priceText = (TextBox)dataItem.FindControl
    ("txtBookPrice");
       bookIdText = (TextBox)dataItem.FindControl("txtBookId");
    
    Updatecode_for_perticular_row ();
    
       }
    txtBookPrice= textbox from which you want to update txtBookId= test i.e. unique id coming from database

    With help of unique id in for loop find particular text in textbox and update.

  3. #3
    MyersGray is offline Senior Member
    Join Date
    Dec 2009
    Posts
    197
    Rep Power
    4

    Default

    First of all load 50 records to DataGrid and add another template field like" Chech Box" finally add one button in your page for update operation. You write code whatever Checkbox click finds all row ids and you can update row based on chosen ids…

Similar Threads

  1. new column in datagrid
    By MartinWilson in forum Programming
    Replies: 1
    Last Post: 02-17-2010, 05:37 PM
  2. Modify the blush of the boxes in a datagrid
    By WalkerCook in forum Programming
    Replies: 2
    Last Post: 02-13-2010, 02:41 PM
  3. DataGrid with Fixed legend & scroll in ASP.NET
    By MyersGray in forum Programming
    Replies: 2
    Last Post: 02-10-2010, 05:44 PM
  4. VIBlend DataGrid for Silverlight
    By SmithJohnson in forum Operating System
    Replies: 1
    Last Post: 01-29-2010, 05:51 PM
  5. Replies: 1
    Last Post: 10-29-2009, 11:33 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48