This is a migrated thread and some comments may be shown as answers.

Method similar to GridViewBoundColumnBase.GetValueForItem but returns the actual value of the property?

1 Answer 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jan Paolo
Top achievements
Rank 1
Jan Paolo asked on 16 May 2019, 06:04 PM

Hello,

Given <telerik:GridViewDataColumn DataMemberBinding="{Binding Number, StringFormat=C}" />..
If I use GetValueForItem, I get the formatted value (e.g. $1.00)..
Is there a method so I can get "1" instead?

Thank you,

Jan

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 21 May 2019, 08:31 AM
Hello Jan,

You can get the desired value by using the GetValue method of the BindingExpressionHelper class. The class is defined in the Telerik.Windows.Controls namespace.

var value = BindingExpressionHelper.GetValue(item, column.DataMemberBinding);

Please let me know if this works for you.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Jan Paolo
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or