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?
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
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.
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!
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.
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
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
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