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

Setting FileExplorer paths in FormTemplate of a Grid

3 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Spencer
Top achievements
Rank 1
Spencer asked on 17 Nov 2015, 12:47 AM

I have a grid that uses a form template for editing the grid items.  When the user clicks the edit command for a row in the grid it opens the FormTemplate that contains a FileExplorer.  I need to then set the configuration path of the file explorer as it's different for each item in the grid.

It seems the FileExplorer paths can only be set on the page_load event, but at that time I don't have access to the GridEditFormItem that allows me to get the file explorer control and set the paths.

Is there a way to make this work?  It seems pretty strange that the view paths can only be set in the page_event.

Thanks

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 19 Nov 2015, 09:11 AM
Hello Spencer,

You can use the ItemCreated or ItemDataBound event handler to achieve this requirement. Please check the following section for a viable approach appropriate for tour chosen EditMode:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode

Hope this helps.

Regards,
Eyup
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Spencer
Top achievements
Rank 1
answered on 19 Nov 2015, 05:47 PM
This doesn't work because the view path of the file explorer control needs to be set on the page_load event.
0
Eyup
Telerik team
answered on 24 Nov 2015, 09:51 AM
Hi Spencer,

Have you tried both in ItemCreated and ItemDataBound? Alternatively, you can use the own event handlers of the control - Init, Load, PreRender:
protected void RadFileExplorer1_PreRender(object sender, EventArgs e)
{
    RadFileExplorer explorer = (RadFileExplorer)sender;
    GridDataItem item = (GridDataItem)explorer.NamingContainer;
    string value = item.GetDataKeyValue("OrderID").ToString();
}

Regards,
Eyup
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Spencer
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Spencer
Top achievements
Rank 1
Share this question
or