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

[Solved] Disable RadComboBox inside RadGrid

3 Answers 190 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zed
Top achievements
Rank 1
Zed asked on 21 Oct 2009, 02:29 PM
How do I find the RadComboBox on Page_Load and disable it?  Thanks

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Oct 2009, 08:59 PM
Hello Zed,

You won't be able to access the RadComboBox on Page_Load when RadGrid is created for the first time because the items are not available yet at this point. Therefore I recommend you use the ItemCreated event handler instead.

Let me know if you need more information.

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Zed
Top achievements
Rank 1
answered on 23 Oct 2009, 10:42 AM
please show me how to find and disable the radcombobox in the radgrid_itemcreated event handler

Thanks
0
Princy
Top achievements
Rank 2
answered on 23 Oct 2009, 10:58 AM
Hello Zed,

Here's an example to access a radcombobox in the ItemTemplate of a GridTemplateColumn in the ItemCreated event of the grid:
aspx:
<telerik:GridTemplateColumn UniqueName="TemplateColumn"
     <ItemTemplate>                            
           <telerik:RadComboBox ID="RadComboBox1" runat="server"
           </telerik:RadComboBox> 
     </ItemTemplate> 
</telerik:GridTemplateColumn> 

c#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    {  
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            RadComboBox combo = item.FindControl("RadComboBox1"as RadComboBox;  
            combo.Enabled = false;
        } 
   } 

Thanks
Princy.
Tags
Grid
Asked by
Zed
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Zed
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or