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

Grid EditFormType

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amol
Top achievements
Rank 2
Amol asked on 10 Nov 2008, 03:26 PM
HI Team,

I am using the grid with EditFormType="Template"  .
and in FormTemplate i am using the rad combox .
while editing the record i need to fill that combo from the database .
i tried it on the itemCommad event of grid , how ever i didn't get the control by using the findcontrol method.

        GridEditFormItem formItem = (e.Item as GridDataItem).EditFormItem as GridEditFormItem;
        RadComboBox box = (formItem.FindControl("drpQType") as RadComboBox).Text;
it returns null reference for the combobox.
plz help me for this issue.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Nov 2008, 04:25 PM
Hello Amol,

Could you please try the following approach?
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    GridEditFormItem item = e.Item as GridEditFormItem; 
    if (item != null && item.IsInEditMode) 
    { 
        RadComboBox box = item.FindControl("drpQType"as RadComboBox; 
        string myText = box.SelectedValue; 
    } 

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products. 
Tags
Grid
Asked by
Amol
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Share this question
or