However, I want this to display as "$100,000.00". Nothing I've tried has worked. This shouldn't be difficult...
<
telerik:GridViewComboBoxColumn
Width
=
"Auto"
DataMemberBinding
=
"{Binding ProjectPhaseLoanId}"
DisplayMemberPath
=
"ApplicationAmount"
Header
=
"Loan/Amount"
ItemsSource
=
"{Binding ProjectPhase.Loans}"
SelectedValueMemberPath
=
"Id"
/>
5 Answers, 1 is accepted
Have you tried configuring the GridViewComboBoxColumn with
DataFormatString="{}{0:C2}"?
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I am sorry to hear this does not work either. Such an error indicates that the expected format is different than the format of the entered value. In order to avoid any misunderstandings may I ask you to isolate the exact case in a demo project with your specific implementation and send it to us via a new support ticket?
You can also refer to the following blog post on how to isolate a problem. That way I will check it locally and try suggesting a solution for this exact case.
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Hello,
I see this post is over a year old, but I am also experiencing the same issue. I created a very basic app to isolate the issue and was successful at doing so.
In the attached solution, if I add DataFormatString="{}{0:C}" to the GridViewComboBoxColumn, I get the same error reported by Greg.
Can you please take a look and let me know if there are other solutions to this, or if this is indeed a bug. I have tested with the latest release, as well as the latest internal build with same results.
Here is a link to the solution: DataFormatString.zip
Thanks,
Chris
Actually, the DataFormat string is not respected by ComboBox column, because of the lookup logic which has to be done. What you can try in this case would be to predefine the ItemTemplate and apally and converter like so:
<
telerik:GridViewComboBoxColumn
DataMemberBinding
=
"{Binding CountryId}"
UniqueName
=
"Country"
ItemsSource
=
"{Binding Countries,Source={StaticResource MyViewModel}}"
SelectedValueMemberPath
=
"Id"
DisplayMemberPath
=
"Name"
>
<
telerik:GridViewComboBoxColumn.ItemTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Name,Converter={StaticResource conv}}"
Grid.Column
=
"1"
></
TextBlock
>
</
DataTemplate
>
</
telerik:GridViewComboBoxColumn.ItemTemplate
>
</
telerik:GridViewComboBoxColumn
>
You can check the section "Templating GridViewComboBoxColumn" from this help article.
Regards,
Yoan
Telerik