This is a migrated thread and some comments may be shown as answers.

Update dynamic grid on button click

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kshitiz
Top achievements
Rank 1
Kshitiz asked on 14 May 2012, 08:54 AM
I have  made a dynamic grid and now i want to update my sp from the values in textbox in radgrid
how can i do that ..
when i try to access the value it alwas gives me the old value .
How can i get the new value ?
 public void Update_OnbuttnClick(object sender, EventArgs e)
        {
               double total;
                string id;

               for (int OuterCol = 1; OuterCol < gridCntrl.Columns.Count; OuterCol++)
                  {
                      GridTemplateColumn templateColumn = new GridTemplateColumn();
                      //string templateColumnName = ds.Tables[0].Columns[OuterCol].ColumnName;

                for (int inner = 1; inner < gridCntrl.Items.Count; inner++)
                {

                    total = double.Parse((gridCntrl.Items[OuterCol].FindControl("xyz") as RadNumericTextBox).Value.ToString());
                    id = (gridCntrl.Items[OuterCol].FindControl("Petroleum") as RadNumericTextBox).Text.ToString();

                }



            }




        }

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 14 May 2012, 05:16 PM
Hi,

The new values which the user entered before triggering the Update command can be fetched calling the ExtractValuesFromItem method. Refer to the help article below for additional information:
http://www.telerik.com/help/aspnet-ajax/grid-retrieve-original-values-for-edited-item.html
              
Kind regards,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Kshitiz
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or