modify FIlter in radgrid

5 posts, 0 answers
  1. Anand
    Anand avatar
    4 posts
    Member since:
    Mar 2016

    Posted 08 Apr Link to this post

    Hi,

    I need to modify the filter for radgrid.

    As per the requirement i have to use different filter option for different column and reduce the filter option(only contain filter) for default radgrid headercontect type of filter.

    Please find the requirement and current implement of rad grid filter.

    Any sample code with be greatly helpful.

    Thanks.

  2. Anand
    Anand avatar
    4 posts
    Member since:
    Mar 2016

    Posted 08 Apr Link to this post

    code in aspx page
     <telerik:RadGrid
                        runat="server"
                        ID="gvSiteInventory"
                        AllowPaging="false"
                        SelectionMode="FullRowSelect"
                        AllowMultiRowSelection="true"
                        ShowHeader="True" 
                        AllowSorting="True" 
                        AllowFilteringByColumn="true"
                        EnableHeaderContextMenu="true" 
                        FilterType="HeaderContext" 
                        AutoGenerateColumns="false" GroupingEnabled="false"
                        EnableHeaderContextFilterMenu="true"
                        OnFilterCheckListItemsRequested="gvSiteInventory_FilterCheckListItemsRequested">    
            
            <MasterTableView AllowPaging="True" PageSize="50">
                 <Columns>
                    <telerik:GridBoundColumn DataField="SiteName" AllowFiltering="true" 
                        UniqueName="SiteName1" HeaderText="Site Name" AllowSorting="true" >
                        </telerik:GridBoundColumn>                 
                     <telerik:GridBoundColumn DataField="Department" 
                         UniqueName="Department1" HeaderText="Department" 
                         AllowSorting="true" AllowFiltering="true" FilterCheckListEnableLoadOnDemand="true" >
                        </telerik:GridBoundColumn>
                     
                    </Columns>
            </MasterTableView>
                    </telerik:RadGrid>

    Code in cs file

    protected void Page_Load(object sender, EventArgs e)
            {
                BindGridView();
            }


            private void BindGridView()
            {
                gvSiteInventory.DataSource = Utilities.GetSiteInventoryDetails();
                gvSiteInventory.DataBind();
            }

            protected void gvSiteInventory_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
            {
                string DataField = (e.Column as IGridDataColumn).GetActiveDataField();

                e.ListBox.DataSource = Utilities.GetSiteInventoryDetails();
                e.ListBox.DataKeyField = DataField;
                e.ListBox.DataTextField = DataField;
                e.ListBox.DataValueField = DataField;
                e.ListBox.DataBind();
            }

    For SiteName column only contain filter with sorting is required and for Department column checkbox filter with sorting only required.

    Thanks.


  3. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 13 Apr Link to this post

    Hi,

    I am afraid that customizing HeaderContext filter menu with the current version of RadGrid control is not supported. Sorry for the inconvenience caused.

    Regards,
    Pavlina
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  4. Anand
    Anand avatar
    4 posts
    Member since:
    Mar 2016

    Posted 14 Apr in reply to Pavlina Link to this post

    Hi, I have customized the Header Context filter. Current issue is that for particular row particular filter option i have to show.

    For checkbox column i have to hide "FilterMenuParent" option (find the attachment).

    Also clear button is not working for checkbox column.

    Please reply ASAP.

    Thanks,

    Anand Kumar

  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 19 Apr Link to this post

    Hi Anand,


    Please review the support ticket you have opened for the same issues.


    Regards,
    Maria Ilieva
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top