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

UpdateCommand Event

1 Answer 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Naveed
Top achievements
Rank 2
Naveed asked on 09 Jan 2009, 01:47 PM

UserControl

userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);

 

 

 

 

 


every thing is going fine. but when i press the edit button the control is displayed with the data, and then when i press the update button it will jump into the UpdateCommand Event of radgrid. the above mention statement is written in the event but it is not giving the reference of the usercontrol.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Jan 2009, 06:22 AM
Hello Naveed,

I tried the following code to reference the usercontrol and its working fine. I'm not sure of what is happening at your end but i would advice you to paste your aspx as well as related server side code here so that i could look into it.
aspx:
<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AutoGenerateColumns="false" runat="server" OnUpdateCommand="RadGrid1_UpdateCommand" > 
 <MasterTableView EditMode="EditForms" DataSourceID="SqlDataSource1" >        
   <EditFormSettings EditFormType="WebUserControl" UserControlName="WebUserControl.ascx" >                   
      <EditColumn UniqueName="EditCommandColumn1"
      </EditColumn>               
  </EditFormSettings> 
 </MasterTableView>  
</telerik:RadGrid>   
 

cs:
 protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) 
    {         
        UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID); 
       
    } 

Thanks
Princy.
Tags
Grid
Asked by
Naveed
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or