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

Hierarchial grid get detailtable items

5 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ramraj
Top achievements
Rank 1
Ramraj asked on 21 Jul 2010, 01:57 PM
Hi

Am using Hierarchial grid with hierarchyloadmode as client.Also i set detailtable Gridboundcolumns to edit mode with inline editing.

While saving am not able to get the detail table items using

(radgrid1.items[0].ChildItem.NestedTableViews[0].Items[1]["ServiceTypeKey"].controls[0] as textbox).text

Please provide me with sample


Regards

Sathya

5 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 26 Jul 2010, 11:00 AM
Hi Ramraj,

To get the edited or inserted item from detail tables you could try getting it into the RadGrid.UpdateCommand or RadGrid.InsertCommand. For example:
void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
{
     string OrderID = ((e.Item as GridEditFormItem)["OrderID"].Controls[0] as TextBox).Text;
}

Additionally I am sending you a simple example. Please check it out and let me know if it helps you.

All the best,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ramraj
Top achievements
Rank 1
answered on 26 Jul 2010, 11:24 AM
Hi Radoslav,

Thank you for the support & providing me the sample.

In my requirement  i set all rows in detailtable to edit mode.I update the database of edited rows as batch with a button click without editcommand.

can you please provide a sample

Thanks

Sathya


0
Radoslav
Telerik team
answered on 29 Jul 2010, 09:43 AM
Hello Ramraj,

To achieve the desired functionality you could try executing the following code snippet on Save button click:
GridItemCollection items = RadGrid1.EditItems;
foreach (GridDataItem item in items)
{
    GridEditFormItem editItem = item.EditFormItem;
    string OrderID = (editItem["OrderID"].Controls[0] as TextBox).Text;
     // Update item
}

Please give it try and let me know if you experience any problems.

Greetings,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ramraj
Top achievements
Rank 1
answered on 02 Aug 2010, 10:58 AM
Hi Radoslav,

Thank you for the prompt Reply,

The problem am facing is that when i click save button the detailtems are not in edit mode.So am not able to convert the items to editformitem and retrieve the value.

Please help me out.


Thanks & Regards

Sathya

0
Radoslav
Telerik team
answered on 05 Aug 2010, 09:30 AM
Hi Ramraj,

If your items are not in edit mode you could not get the values from the controls which appear when the grid is in edit mode. Could you please send us a simple runnable example which demonstrating the unwanted behavior . You could open a formal support ticket from your Telerik account and attach a ZIP file there. Or post your aspx page with a code behind file here. Thus I will be able to gather more details about your scenario and if it is possible to provide you a solution.
Looking forward for your reply.

Regards,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Ramraj
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Ramraj
Top achievements
Rank 1
Share this question
or