HI!
Is there any way to filter zeroes in the RadGridView? i copied the exact code from your sample GridView: Search As You Type and unfortunately, it is not possible to filter the data containing 0s. I can't seem to find any zero-valued entry in your sample and i was wondering if this was intentional because the code cannot filter zeroes?
Is there any way to filter zeroes in the RadGridView? i copied the exact code from your sample GridView: Search As You Type and unfortunately, it is not possible to filter the data containing 0s. I can't seem to find any zero-valued entry in your sample and i was wondering if this was intentional because the code cannot filter zeroes?
7 Answers, 1 is accepted
0
Hello Vincent,
Do you mean numeric zeros or nulls (nothing in VB) ?
Kind regards,
Pavel Pavlov
the Telerik team
Do you mean numeric zeros or nulls (nothing in VB) ?
Kind regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vincent
Top achievements
Rank 1
answered on 26 Apr 2011, 01:08 AM
I mean integral or numeric zeros. When there are columns with zero values. The filterdescriptor( or search) won't work. But, if there are no zero values in the datagrid, it perfectly works.
0
Hello Vincent,
I have entered some zeroes in the online sample and tried filtering . It seems to work OK .
Please check this http://screencast.com/t/3vN3hCIVhn . Am I missing something ?
All the best,
Pavel Pavlov
the Telerik team
I have entered some zeroes in the online sample and tried filtering . It seems to work OK .
Please check this http://screencast.com/t/3vN3hCIVhn . Am I missing something ?
All the best,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vincent
Top achievements
Rank 1
answered on 26 Apr 2011, 10:19 AM
HI Telerik!
Thank you for responding.
I think I misstated the question.
We have the same output as what you posted on the link. But, if we search for a certain string with zero values in another columns, the search filter would not work properly.
To simplify this, can you try searching for "Wilmk" and "Tradh" in your example video.... What will be the outcome?
I hope you'll reply... Thank you so much! If possible, please post again the video with your experiment... :):):)
Thank you for responding.
I think I misstated the question.
We have the same output as what you posted on the link. But, if we search for a certain string with zero values in another columns, the search filter would not work properly.
To simplify this, can you try searching for "Wilmk" and "Tradh" in your example video.... What will be the outcome?
I hope you'll reply... Thank you so much! If possible, please post again the video with your experiment... :):):)
0
Hi Vincent,
Thanks for the clarifications! I was able to reproduce the erroneous behavior . Indeed there is some missing logic in the sample code .
I was able to isolate it to the following method :
When trying to convert the string value entered to numeric type for the numeric column , the code fails and falls back to the default value for the type - in this case 0. So an unneeded FilterDescriptor with value 0 is created.
As a workaround I may suggest to exclude the numeric column when creating the FilterDescriptors.
A simple check may be added to :
in order to prevent adding a filter descriptor for the numeric column .
Thank you for pointing our attention to that problem. We are going to update the online example.
I am updating your Telerik points.
Kind regards,
Pavel Pavlov
the Telerik team
Thanks for the clarifications! I was able to reproduce the erroneous behavior . Indeed there is some missing logic in the sample code .
I was able to isolate it to the following method :
private
void
UpdateCompositeFilterValues()
{
foreach
(FilterDescriptor descriptor
in
this
.compositeFilterDesriptor.FilterDescriptors)
{
object
convertedValue = DefaultValue(descriptor.MemberType);
try
{
convertedValue = Convert.ChangeType(
this
.FilterValue, descriptor.MemberType, CultureInfo.CurrentCulture);
}
catch
{
}
if
(descriptor.MemberType.IsAssignableFrom(
typeof
(DateTime)))
{
DateTime date;
if
(DateTime.TryParse(
this
.FilterValue,
out
date))
{
convertedValue = date;
}
}
descriptor.Value = convertedValue;
}
}
When trying to convert the string value entered to numeric type for the numeric column , the code fails and falls back to the default value for the type - in this case 0. So an unneeded FilterDescriptor with value 0 is created.
As a workaround I may suggest to exclude the numeric column when creating the FilterDescriptors.
A simple check may be added to :
foreach
(GridViewDataColumn column
in
columns)
{
this
.compositeFilterDesriptor.FilterDescriptors.Add(
this
.CreateFilterForColumn(column));
}
in order to prevent adding a filter descriptor for the numeric column .
Thank you for pointing our attention to that problem. We are going to update the online example.
I am updating your Telerik points.
Kind regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vincent
Top achievements
Rank 1
answered on 29 Apr 2011, 02:18 PM
HI!
Thank you Telerik!
When will you update the example in your site? :)
Thank you Telerik!
When will you update the example in your site? :)
0
Hi Vincent,
Online examples are updated on each official release. In our case this means the very next service pack .
Regards,
Pavel Pavlov
the Telerik team
Online examples are updated on each official release. In our case this means the very next service pack .
Regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items