- Home
- Forum
- ASP.NET Web Forms (Classic)
- Update Gridview on single button click
Update Gridview on single button click
- Jun 18, 2009 09:53 AM UTC
- Oct 23, 2013 09:10 AM UTC
I am using GridGrouping control , I set ExcelEditMode="True" ,i also have the checkbox column. Now what i want is after making changes in grid i clicked on Save button and that button will loop over that gridview and save updated record in database and refresh grid with updated values.I am using dataset to bind gridview.. please provide me code sample if possible.(see attached image)
SIGN IN To post a reply.
4 Replies
HT
Harshad Teli
June 18, 2009 10:30 AM UTC
I am using SQL Server2005 and VS2008
RP
Rekha P
Syncfusion Team
June 22, 2009 11:56 AM UTC
Hi Harsha,
Thank you for your interest in Syncfusion Products.
The Essential Grid provides support for Excel-like Edit for all editable fields. This feature offers cell in-line editing, cell selection and row selection. Please find a simple sample illustrtaing Excel Like Edit feature.
http://files.syncfusion.com/support/GGC.Web/7.2.0.37/F82654/Sample.zip
Features illustrated in above sample:
- GridGroupingControl is binded with SqlDataSource.
- ExcelEditMode is enabled with a column [Discontinued] with CheckBox.
- Updated values can be retrieved via Save button click and then updated into DataBase.
- Get the TableRow in the TopLevelTable.
- Check if that Row is GridRow if so Iterate the updated Records. Please refer the code snippet.
Please have a look at the above sample and let me know if this helps you out.
Thanks,
Rekha
Thank you for your interest in Syncfusion Products.
The Essential Grid provides support for Excel-like Edit for all editable fields. This feature offers cell in-line editing, cell selection and row selection. Please find a simple sample illustrtaing Excel Like Edit feature.
http://files.syncfusion.com/support/GGC.Web/7.2.0.37/F82654/Sample.zip
Features illustrated in above sample:
- GridGroupingControl is binded with SqlDataSource.
- ExcelEditMode is enabled with a column [Discontinued] with CheckBox.
- Updated values can be retrieved via Save button click and then updated into DataBase.
- Get the TableRow in the TopLevelTable.
- Check if that Row is GridRow if so Iterate the updated Records. Please refer the code snippet.
void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "";
foreach (TableRow row in this.GridGroupingControl1.TopLevelTable.Rows)
{
if (row is GridRow)
{
GridRow gridRow = row as GridRow;
if (gridRow.Record != null)
{
foreach (GridColumnDescriptor gcd in this.GridGroupingControl1.TableDescriptor.Columns)
{
Label1.Text += gridRow.Record.GetValue(gcd.Name) + "--";
}
Label1.Text += "
";
//Update the values into the database.
}
}
}
}Please have a look at the above sample and let me know if this helps you out.
Thanks,
Rekha
FE
Fernando
August 7, 2012 10:55 AM UTC
Hi! I am trying to accomplish this, the sample posted here is not available, can you send me a similar sample? Thanks!
Regards,
Fernando
SD
Sandhya D
Syncfusion Team
October 23, 2013 09:10 AM UTC
Hi Fernando,
Thanks for your interest in syncfusion products.
We have created a similar sample based on your requirement , Please refer the code below.
[Default.aspx.cs]:
public void button2_Click(object sender, EventArgs e)
{
Label1.Text = "";
foreach (TableRow row in this.GridGroupingControl1.TopLevelTable.Rows)
{
if (row is GridRow)
{
GridRow gridRow = row as GridRow;
if (gridRow.Record != null)
{
foreach (GridColumnDescriptor gcd in this.GridGroupingControl1.TableDescriptor.Columns)
{
Label1.Text += gridRow.Record.GetValue(gcd.Name) + "--";
}
Label1.Text += "";
//Update the values into the database.
}
}
}
}
[Default.aspx]:
<asp:Button ID="Button2" onClick="button2_click" runat="server" Text="Getdata" OnClientClick="update()"/>
We have attached sample for your reference.Please get back to us if you need further assistance.
Regards,
Sandhya D
LocalizeGrid_5e6fea31.zip
SIGN IN To post a reply.
- 4 Replies
- 4 Participants
-
HT Harshad Teli
- Jun 18, 2009 09:53 AM UTC
- Oct 23, 2013 09:10 AM UTC