Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
10 views

I've set

<telerik:GridTemplateColumn ... ShowFilterIcon="True">

but no icon appears when I apply a filter. Conversely, a sort icon does appear when I apply a sort.

Sorting is achieved by clicking on the column header, but for filtering, I am using a header context menu. Is that the source of the problem?

  • If so, how can I have the filter icon show in the column header when filtering is applied via a header context menu?
  • If not, why else might the filter icon now display when filtering is applied?
Vasko
Telerik team
 answered on 23 Apr 2025
1 answer
12 views

I have created an application within Visual Studio 2019 and using c#.

The project has a page which uses a telerik RadGrid. It is populated on page load and I have filtering enabled on 3 of the columns. I have set the aspx for the columns to have AutoPostBackOnFilter="true" AllowFiltering="true"  ShowFilterIcon="true"

The runs perfectly when ran in development environment but when I publish my application to the web server the filter does not work at all. Nothing happens if I tab out of the filter text box or if I select anything from the filter icon.

Can anyone advise what the issue could be please? I am using Telerik.web.ui version 2024.1.131.45

Thanks

RR

Vasko
Telerik team
 answered on 18 Apr 2025
1 answer
16 views

I am using Visual Studio 2019 c#

I have a telerik radgrid which has a column named StageStDate which is in string format but shows a date in format dd-mmm-yy. This column has filtering enabled with a date picker.

I have a hidden column named StageStartDate which is a replicate of StageStDate but is a date column and in format DD/MM/YYYY.

As StageStDate wont filter correctly as its a string format, when user select a date for this column from filter I would like the filtering to apply to the StageStartDate column, how can I achieve this please?

On ItemCommand I have changed the Pair Second to StageStartDate instead of StageStDate

 

but for some reason this makes the filterExpression blank.

Rumen
Telerik team
 answered on 31 Mar 2025
1 answer
42 views

Hi, I have a RadGrid with AllowFilteringByColumn="True" and multiple columns with with the properties set up for filtering, like so:
AutoPostBackOnFilter="false" FilterControlWidth="100%" CurrentFilterFunction="StartsWith" ShowFilterIcon="false" FilterDelay="4000"

When I filter by 1 column, it works fine. Then I filter by an additional column, it works fine.

The problem seems to be when I clear those 2 column filters at the same time.  The first column that is cleared, retains the filter value.

Another option would be to only do the filter when the user hits <enter>.  After thinking about it, this may be the better choice, anyway, as it is more what the users are accustomed to.  I see a bunch of old answers on how to do this, but nothing very current.

Thanks!

Vasko
Telerik team
 answered on 19 Nov 2024
0 answers
52 views
I need to be able to add an "In Time Period" comparison operator option to the dropdown list.  Once the user has selected this option we would display a custom RadFilterDataFieldEditor with a dropdown list of options to choose from ("In Next 7 days", "In Next 30 days", etc).  This would be displayed in place of the built-in calendar control that would be displayed if they chose another comparison operator (such as "Greater than", etc).  How do I add a new comparison operator to the list?  The documentation shows how to remove menu items (Customizing the Menu), but not how to add menu items.  Please advise.  Thanks
Todd
Top achievements
Rank 1
 asked on 24 Apr 2024
0 answers
90 views
Hello,

When I tried to filter my other columns it seems working, but for the payment type column, im getting error: At least one object must implement IComparable

Client model:
public Guid Id { get; set; }

[Display(Name = "Client Code")]
public string Ref { get; set; }

[Display(Name = "Company Name")]
public string CompanyName { get; set; }

[Display(Name = "Payment Options")]
public List<PaymentTypeViewModel> PaymentTypes { get; set; }


payment type model:
using System;

namespace Act2.Certificate.Api.Models.Client
{
    public class PaymentTypeViewModel
    {
        public Guid Id { get; set; }

        public string Name { get; set; }

        public bool Selected { get; set; }
    }
}


Controller file:
    public async Task<IActionResult> GetClientList([DataSourceRequest] DataSourceRequest request
       )
    {
        try
        {
            var list = await _mediator.Send(new ClientsQuery());
            
            DataSourceResult result = list.ToDataSourceResult(request);
            return new JsonResult(result);
        }
        catch (Exception ex)
        {
            return BadRequest(new { message = ex.Message });
        }
    }
}

Do take note, that the payment type has multiple value per row, see below image:
Francis
Top achievements
Rank 1
 asked on 11 Apr 2024
1 answer
58 views

Is there a way to search for files in the directories when using the Document Manager/Image Manager.  I see some code samples that allow for filtering in the selected folder, however that only filters one level and not sub directories.  Looking for a way to search filenames through all sub folders.

 

Rumen
Telerik team
 answered on 21 Mar 2024
1 answer
92 views

Hi,

Could you, please help me find code examples for how to format filter dropdown items of decimal and datetime fields(columns) in telerik:RadGrid.
We need a comma separator for decimal fields.  Also, there is a chance of negative values, so in that case, we need to show its absolute value(within parentheses).
In the case of datetime fields, we need only the date without the time part (date format will be different for different agencies).

We changed the format of Invoice Date column in  ItemDataBound event as below.

dataItem["Date"].Text = rowItem.Date.ToString(AgencyDateFormat);

But it only changed the grid column values, not the filter dropdown.(image of mentioned issue is given below)

We changed the format of Amount column in  ItemDataBound event as below.

dataItem["Amt"].Text = string.Format("{0:0,0.00;(0.00)}", rowItem.Amt);

But it only changed the grid column values, not the filter dropdown.(image of mentioned issue is given below)

 

What we need is for the values shown in the filter will be in the same format of the corresponding column.

I solved this issue by using following code:

private void RadGrid_GridFilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
            string filterKey = e.Column.UniqueName;
            List<string> listOfItems = GetList(filterKey);

            foreach (var item in listOfItems)
            {
                if (e.Column.DataType == typeof(DateTime))
                {
                    DateTime datimeObj;
                    if (DateTime.TryParse(item, out datimeObj))
                    {
                        e.ListBox.Items.Add(new RadListBoxItem
                        {
                            Text = datimeObj.ToString(AgencyDateFormat),
                            Value = item
                        });
                        e.ListBox.DataTextFormatString = AgencyDateFormat;
                    }
                }
                else if (e.Column.DataType == typeof(decimal))
                {
                    decimal moneyObj;
                    if (decimal.TryParse(item, out moneyObj))
                    {
                        e.ListBox.Items.Add(new RadListBoxItem
                        {
                            Text = string.Format("{0:0,0.00;(0.00)}", moneyObj),
                            Value = item
                        });
                    }
                }
                else
                {
                    e.ListBox.DataSource = listOfItems;
                }
            }
            e.ListBox.DataBind();
        }

There is one more issue I'm facing. If the column contains a null or empty string, then I need to show them as "(Empty)" in the filter drop-down. How to do this?

We will appreciate your help.

Thanks

            
Vasko
Telerik team
 answered on 19 Feb 2024
1 answer
117 views

Hi

I have an application that had a telerik Rad Grid, with filtering enabled.

The application can be opened via another application, passing filters to the first 2 columns like below. However when passing the filters like this the rows are not reflecting what is in the filter. If I was to manually enter the value in the filter it will work.

 

I have this in my code for ItemDatabound

 protected void rg_CallDetails_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(department))
                {
                    rg_CallDetails.MasterTableView.FilterExpression = "([Department] " + "LIKE " + "\'%" + department + "%\' AND [CallNumber] " + "LIKE " + "\'" + callTypePre + "%\' ) ";
                    GridColumn column = rg_CallDetails.MasterTableView.GetColumnSafe("Department");
                    column.CurrentFilterFunction = GridKnownFunction.Contains;
                    column.CurrentFilterValue = department;


                    //rg_CallDetails.MasterTableView.FilterExpression = "([CallNumber] " + "LIKE " + "\'" + callTypePre + "%\') ";
                    GridColumn columnCallType = rg_CallDetails.MasterTableView.GetColumnSafe("CallNumber");
                    columnCallType.CurrentFilterFunction = GridKnownFunction.Contains;
                    columnCallType.CurrentFilterValue = callTypePre;

                    rg_CallDetails.MasterTableView.Rebind();

                }
            }

        }

But the application errors with stackoverflow exception error on the rebind.

I have tried rg_CallDetails.Rebind()

But also gives the same error.

Any advise please?

Thanks

 

                                       
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 15 Nov 2023
0 answers
94 views

Hi 

I have radgrid for an application that has the filters set to show.

When the page first loads and grid is populated the filter works successfully, however if I do anything like click on another button so the page reloads for example, the filters stop working. So when I click on the filter button the drop down of options does not show anymore.

Any advise on why its behaving like this please?

Thanks

Rakhee

Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 15 Nov 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?