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

Not able to find the control on ItemCommand

2 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chetan
Top achievements
Rank 1
Chetan asked on 28 Jul 2010, 08:26 AM
Hi,

I am having problem in finding the radcombobox in RadGrid detail table on ItemCommand Event.

Actually the scenario is, When User click on the Add New Item an empty form is opened, in this form there are some controls , so On Item Command I want to find these controls and set it's visibility and default values.

but while doing so I am facing error that cannot convert the ItemCommandItem to GridEditableItem. So How to find these controls and set their respective properties.?

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 28 Jul 2010, 10:02 AM
Hello Chetan,

The insert form is not yet created at this point.
If you want just to hide a given control you could use the ItemCreated event:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is IGridInsertItem && e.Item.OwnerTableView.Name == "myDetailTable")
    {
        ...e.Item.FindControl("myControl);
    }
}

I recommend that you examine the following links for more information on how to set default values programmatically:
Inserting values in-place and EditForms
Inserting values using UserControl/FormTemplate

Regards,
Daniel
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
Chetan
Top achievements
Rank 1
answered on 28 Jul 2010, 10:05 AM
Thanks
Daniel
Tags
Grid
Asked by
Chetan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Chetan
Top achievements
Rank 1
Share this question
or