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

modify FIlter in radgrid

4 Answers 231 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Anand
Top achievements
Rank 1
Anand asked on 08 Apr 2016, 08:21 PM

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.

4 Answers, 1 is accepted

Sort by
0
Anand
Top achievements
Rank 1
answered on 08 Apr 2016, 08:26 PM

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.

0
Pavlina
Telerik team
answered on 13 Apr 2016, 04:10 PM
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.
0
Anand
Top achievements
Rank 1
answered on 14 Apr 2016, 07:06 PM

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

0
Maria Ilieva
Telerik team
answered on 19 Apr 2016, 03:31 PM
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.
Tags
Sharepoint Integration
Asked by
Anand
Top achievements
Rank 1
Answers by
Anand
Top achievements
Rank 1
Pavlina
Telerik team
Maria Ilieva
Telerik team
Share this question
or