Hi,
In rad grid I have button in Footer. When I click this "AddorUpdateButton" need to update all the edited records. Its working fine.
But When I am using Add New Record button from above the header and then when I click "AddorUpdateButton" its won't take new record its taking only Edited row only.
Please help me on this..!
Thanks & Regards,
Raja M
In rad grid I have button in Footer. When I click this "AddorUpdateButton" need to update all the edited records. Its working fine.
But When I am using Add New Record button from above the header and then when I click "AddorUpdateButton" its won't take new record its taking only Edited row only.
Please help me on this..!
Thanks & Regards,
Raja M
8 Answers, 1 is accepted
0

Jayesh Goyani
Top achievements
Rank 2
answered on 01 Feb 2012, 11:24 AM
Hello,
Thanks,
Jayesh Goyani
// put grid in to insert mode
RadGrid1.MasterTableView.IsItemInserted =
true
;
RadGrid1.Rebind();
// get all Edited Items
foreach
(GridEditableItem item
in
RadGrid1.EditItems)
{
}
// get Inserted Items
GridEditableItem Inserteditem = RadGrid1.MasterTableView.GetInsertItem();
Thanks,
Jayesh Goyani
0

Raja M
Top achievements
Rank 1
answered on 02 Feb 2012, 11:47 AM
Hi Jayesh,
Its working fine. Thanks a lot..!
I am facing one more issue on the DetailTables. I am not able to get the DetailTable Items using GridFooterItem.
When I am using the above code I just get only the Parent Grid Items only.
Could you pls help me on this.
Thanks & Regards,
Raja M
Its working fine. Thanks a lot..!
I am facing one more issue on the DetailTables. I am not able to get the DetailTable Items using GridFooterItem.
foreach
(GridDataItem dataItem
in
radGrdGauge.MasterTableView.Items)
{
}
Could you pls help me on this.
Thanks & Regards,
Raja M
0
Accepted

Shinu
Top achievements
Rank 2
answered on 02 Feb 2012, 11:56 AM
Hello Raja,
I suppose you want to access the detail table view. Here is the sample code.
C#:
-Shinu
I suppose you want to access the detail table view. Here is the sample code.
C#:
if
(e.Item.OwnerTableView.Name ==
"DetailTable"
)
{
GridTableView table= (GridTableView)e.Item.OwnerTableView;
GridDataItem parentItem = (GridDataItem)table.ParentItem;
}
-Shinu
0

Raja M
Top achievements
Rank 1
answered on 02 Feb 2012, 12:42 PM
Hi Shinu,
Its working fine. Thank u very much...!
I just use the above syntax with slight modification inside Item Command.
Regards,
Raja M
Its working fine. Thank u very much...!
I just use the above syntax with slight modification inside Item Command.
foreach
(GridDataItem dataItem
in
e.Item.OwnerTableView.Items)
{
}
Regards,
Raja M
0

Raja M
Top achievements
Rank 1
answered on 07 Feb 2012, 06:09 PM
Hi Jayesh,
In Item Command I am able to update multiple records.
When I am using button for update its update properly in the DataBase but not refresh in the RadGrid.
Could u pls help me on this..!
In Item Command I am able to update multiple records.
When I am using button for update its update properly in the DataBase but not refresh in the RadGrid.
if
(e.CommandName == RadGrid.UpdateCommandName)
{
e.Item.OwnerTableView.Rebind();
}
Could u pls help me on this..!
0

Shinu
Top achievements
Rank 2
answered on 08 Feb 2012, 05:25 AM
Hello Raja,
RadGrid will automatically refresh after Update/Insert/Delete operation if you are binding the Grid in the NeedDataSource event.
-Shinu.
RadGrid will automatically refresh after Update/Insert/Delete operation if you are binding the Grid in the NeedDataSource event.
-Shinu.
0

Raja M
Top achievements
Rank 1
answered on 08 Feb 2012, 10:00 AM
Hi Shinu,
I am using Item Command to update Multiple records but I am not using default Rad Grid Insert/Update/Delete.
Inside Item Command after updating all my data I just call RadGrid1.Rebind().It goes to the NeedDataSource Event without latest updated data. But in Database the values are updated.
Any Idea..!
I am using Item Command to update Multiple records but I am not using default Rad Grid Insert/Update/Delete.
Inside Item Command after updating all my data I just call RadGrid1.Rebind().It goes to the NeedDataSource Event without latest updated data. But in Database the values are updated.
Any Idea..!
protected
void
radGrdWellInfo_ItemCommand(
object
sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if
(e.CommandName ==
"UpdateAllWellInformationData"
)
{
foreach (GridDataItem dataItem in radGrdWellInfo.MasterTableView.Items)
{
update Values;
}
}
radGrdWellInfo.Rebind();//It fires the NeedDataSource Event
}
0
Hello,
Please check this help article which illustrates how to perform batch Updates in RadGrid.
Kind regards,
Andrey
the Telerik team
Please check this help article which illustrates how to perform batch Updates in RadGrid.
Kind regards,
Andrey
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>