We are using the latest release of the Telerik Gridview control for Silverlight 4 in combination with ria services.
Filtering normally works but we have now encountered a problem with the standard filter control when the datatype is a nullable double:
Upon entering a number the filter control will increase the value by factors (example: value 5.00 would be changed to 500.00). It is therefore not possible to enter the correct value.
What can we do about this? Will there be a fix in the next release?
Thanks for your help.
Dan
10 Answers, 1 is accepted
Greetings
Thank you for this report.
I have created a sample project with a RadGridView. One of its columns is bound to a nullable double property. Unfortunately by running this project I was not able to reproduce the behavior that you have described.
Please check the attached project and let me know how is it different from yours?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
The issue is easily reproducable in your solution. The first time you filter it works although the value in the textbox changes to 300 when you enter the value 3 (and not 3.00). However, afterwards, one can no longer correctly filter.
Greetings
Ps: i also tested with the latest release of your controsl. The issue also exists there
When I change the value in the field editor textbox, then instead of '3.00' I get the value '30.00'. I need to delete the '0' myself.
The field editor for the double value is RadMaskedTextBox. Unfortunately this is the expected behavior of the RadMaskedTextBox. For the Q3 2011 release we have scheduled to change the filter editor for double to be MaskedNumericInput field, that will allow the direct input of number.
Until then you could change the Mask of the editor. In order to do this you need to handle FieldFilterEditorCreated event of RadGridView:
private
void
clubsGrid_FieldFilterEditorCreated(
object
sender, Telerik.Windows.Controls.GridView.EditorCreatedEventArgs e)
{
if
(e.Editor
is
RadMaskedTextBox)
{
(e.Editor
as
RadMaskedTextBox).Mask =
"your mask here"
;
}
}
I hope that this is helpful.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thanks for your answer. Thats great. However, do you know which mask I have to enter, so that the input is correct for a decimal value.
The target behaviour is as follows: It should be possible to enter two digits after the coma.
Entered: result:
1 1.00 (displaying 1 would also be ok)
2.23 2.23
In my case, the textbox always multiyplies the displayed value by 100 (example: 3 will be changed to 300.00)
The best (most correct) result i have with a mask == "n0", this way the displayed value is correct but i can no longer enter decimal values, which is not acceptable.
Thanks for your help
Indeed there is not an appropriate mask. This is definitely a problem. That is why you could change the field editor of the FilteringControl to be RadMaskedNumericInput. As I have mentioned in my previous reply we have scheduled to change the filter editor for double to be MaskedNumericInput field.
There is a new method added to GridViewBoundColumnBase:
public
virtual
FrameworkElement CreateFieldFilterEditor()
{
returnFilterEditorFactory.CreateEditor(
this
.DataType);
}
It gives us a perfect opportunity to replace the default field filter editor with the desired one. I have prepared a sample project on how this could be done.
Please check it and let me know if this solution could be applied to your scenario.Best wishes,
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I'm using raddatagrid with double datatype column, and the dinstinct values are not listed correctly. There are too many decimals however I add the value list, as you see in column.
Can you help, why appear those decimals?
Thanks,
Laszlo
This seems to be a general issue with the double values displayed in the stock Silverlight ListBox.
What you can do to avoid such inconvenience is to define a StringFormat for the Binding, or a DataFormatString for the column (for example DataFormatString="{}{0:N2}").
Regards,
Didie
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
The problem is only with Double values. If your values are of type Decimal, then they will be displayed fine.
Regards,Didie
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>