Hi,
I have a submit button in my page, in which i am trying to get the values of the grid and add it to datatable.
I have the below code:
How to retrieve the values in Insert/update/delete mode and add it to a datatable ?
Thanks
I have a submit button in my page, in which i am trying to get the values of the grid and add it to datatable.
I have the below code:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
RadGrid grid = (
this
.FindControl(
"RadGrid1"
)
as
RadGrid);
if
(grid.MasterTableView.IsItemInserted)
{
(grid.MasterTableView.GetItems(GridItemType.CommandItem)[0]
as
GridCommandItem).FireCommandEvent(RadGrid.PerformInsertCommandName,
string
.Empty);
}
else
if
(grid.EditItems.Count > 0)
{
grid.EditItems[0].FireCommandEvent(RadGrid.UpdateCommandName,
string
.Empty);
}
else
{
(grid.MasterTableView.GetItems(GridItemType.Item)[0]
as
GridDataItem).FireCommandEvent(RadGrid.DeleteCommandName,
string
.Empty);
}
}
How to retrieve the values in Insert/update/delete mode and add it to a datatable ?
Thanks