How to allow decimal values in Telerik Silverlight GridViewDataColumn filter dialog?
I've got a data column defined within a RadGridView that uses a currency value. Here's the definition:
<telerik:GridViewDataColumn UniqueName="WSA" Header="WSA" DataMemberBinding="{Binding TicketSalesRolling12WeekAvg, Converter={StaticResource DollarFormatConverter}}">
<telerik:GridViewDataColumn.CellStyle>
<Style TargetType="telerik:GridViewCell">
开发者_Python百科 <Setter Property="HorizontalAlignment" Value="Right"/>
</Style>
</telerik:GridViewDataColumn.CellStyle>
</telerik:GridViewDataColumn>
As the column is defined now, in the filter dialog I can't enter decimal values. So, something like "$2.99" won't work b/c it won't let me enter the decimal point (or the dollar sign, for that matter).
I've tried using a string type as the backing field; that works fine. But then I lose the numeric filter conditions and instead see the string filter conditions ("contains", "starts with", etc.). The user wants to see the numeric filter conditions, which leads me to my current dilemma.
I figure if I can get at the filter dialog template maybe I can manipulate things from there.
Any ideas?
Problem resolved. Just define the column's DataType as "double".
var gridViewBoundColumnBase = cisidsRadGridView.Columns["WSA"] as GridViewBoundColumnBase;
if (gridViewBoundColumnBase != null)
{
gridViewBoundColumnBase.DataType = typeof (double);
}
精彩评论