开发者

How to allow decimal values in Telerik Silverlight GridViewDataColumn filter dialog?

开发者 https://www.devze.com 2023-04-10 08:05 出处:网络
I\'ve got a data column defined within a RadGridView that uses a currency value. Here\'s the definition:

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);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号