Can filtering possible with ShowHeaders="false" ?

6 posts, 0 answers
  1. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 10 Dec 2008 Link to this post

    Can i make a filtering option avaliable if i`v made the header invisible?
    I am filterin my grid just from one column....but when i makes my headers visible = "false", filtering option also vanishes away.
    And how can i disable the filter context menu?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Dec 2008 Link to this post

    Hello Saadi,

    You can hide the header using the code below :
    cs:
    protected void RadGrid1_PreRender(object sender, EventArgs e) 
        { 
            foreach (GridHeaderItem header in RadGrid1.MasterTableView.GetItems(GridItemType.Header)) 
            { 
                header.Display = false
            } 
        } 
                
             

    And for the second part of your question, i suppose you want to disable items in the filter menu. If that is the case refer to the code below:
    cs:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
           GridFilterMenu menu = RadGrid1.FilterMenu; 
           foreach (RadMenuItem item in menu.Items) 
           {            
              if (item.Text == "StartsWith") 
               { 
                   item.Enabled=false
               } 
           } 
        } 

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 10 Dec 2008 Link to this post

    It worked thank you man....
    And if i want that filtering textbox to be on extream right of the grid with a button named search, then what should be done for it?
  5. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 10 Dec 2008 Link to this post

    It worked thank you man....
    And if i want that filtering textbox to be on extream right of the grid with a button named search, then what should be done for it?
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Dec 2008 Link to this post

    Hi Saadi,

    You align the FilteringItem on the extreme right by setting the HorizontalAlign property as shown below.

    ASPX:
    <FilterItemStyle HorizontalAlign="Right" /> 

    Here is a help article which explains how to change the default filter image.
    Setting filter textbox dimensions/changing default filter image


    Shinu.
  7. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 11 Dec 2008 Link to this post

    This isnt working....the filtering textBox is still at same place where it was. What to do?
    I want this textBox at extreme right regardless of which filtering column it belongs to.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017