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

Find ComboBox in PagerTemplate on Grid Prerender

1 Answer 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Grigory
Top achievements
Rank 1
Grigory asked on 29 Feb 2012, 11:13 AM
Hi , if this is correct to find RadComboBox in PagerTemplate?
<PagerTemplate>
<telerik:RadComboBox ID="ddlMoveToFolder" Runat="server"
                                            EnableLoadOnDemand="False" EnableVirtualScrolling="false" 
                                            ShowMoreResultsBox="False"  >
                                            <Items>
                                                <telerik:RadComboBoxItem Text="Select Folder" Value="Select Folder" />
                                            </Items>
</telerik:RadComboBox> 
</PagerTemplate>

protected void grdMessage_PreRender(object sender, EventArgs e)
{
GridPagerItem pagerItem = (GridPagerItem)grdMessage.MasterTableView.GetItems(GridItemType.Pager)[0];
        RadComboBox customFolderDDL = (RadComboBox)pagerItem.FindControl("ddlMoveToFolder");
}

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Feb 2012, 11:23 AM
Hello,
 
You can access the controls in ItemDataBound event as shown below.
C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if (e.Item is  GridPagerItem)
{
   GridPagerItem item = (GridPagerItem)e.Item;
   RadComboBox combo=(RadComboBox)item.FindControl("ddlMoveToFolder");
}
}

-Shinu.
Tags
Grid
Asked by
Grigory
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or