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

Header Context Menu Filter - ComboBox Height

3 Answers 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rory
Top achievements
Rank 1
Rory asked on 16 Aug 2010, 06:49 PM
We are having issues with the height of the 2 RadComboBoxes that are in the Filter Menu. Is there a way to set these to a specific height like 100px?
Thanks.

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 18 Aug 2010, 04:37 PM
Hi Rory,

You could handle on ItemDataBound/ItemCreated event, retrieve a reference to the RadComboBox inside GridFilteringItem and set the properties you need. The following example illustrates how you can change the height of the combo box:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)   
   {   
       if (e.Item is GridFilteringItem)   
       {   
           GridFilteringItem filteringItem = e.Item as GridFilteringItem;   
           RadComboBox combo = (RadComboBox)filteringItem.FindControl("RadComboBox1");         
           combo.Height = Unit.Pixel(100);   
       }   
   }

I hope this helps.

Greetings,
Pavlina
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
Rory
Top achievements
Rank 1
answered on 24 Aug 2010, 07:09 PM
Hi Pavlina,
This code doesn't seem to work. The control "RadComboBox1" is never found. Does this code not work when the Context Menu Header Filter Items are enabled? It seems like the ComboBox would be part of the ContextMenu that is showing on Right Click rather than inside a grid filtering item. 
Thanks.
0
Rory
Top achievements
Rank 1
answered on 24 Aug 2010, 10:46 PM
Found the Answer. Pasted below. Thanks your code at least got me on the right track.

OnInit(EventArgs e)
{
    grid.HeaderContextMenu.ItemCreated += new RadMenuEventHandler(HeaderContextMenu_ItemCreated_SimsBasePage);
}
  
  
public void HeaderContextMenu_ItemCreated(object sender, RadMenuEventArgs e)
{
    if(e.Item.Value == "FilterMenuContainer")
    {
       RadComboBox combo = (RadComboBox)e.Item.FindControl("HCFMRCMBFirstCond");
       if (combo != null)
       {
          combo.Height = Unit.Pixel(500);
       }
  
       RadComboBox combo2 = (RadComboBox)e.Item.FindControl("HCFMRCMBSecondCond");
       if (combo2 != null)
       {
          combo2.Height = Unit.Pixel(500);
       }
   }
}
Tags
Grid
Asked by
Rory
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Rory
Top achievements
Rank 1
Share this question
or