This question is locked. New answers and comments are not allowed.
Hi I have a grid with the following GridViewExpressionColumn
<telerik:GridViewExpressionColumn UniqueName="LineTotal"
Header="{Binding ApplicationStrings.LineTotalColumnHeader, Source={StaticResource ResourceWrapper}}"
IsFilterable="False"
IsReadOnly="True"
Expression="QtyOrd * UnitPrice"
DataFormatString="{}{0:C}"
Width="100"
DisplayIndex="6" />
My application has a dropdown box for Currencies which sets the culture the numeric columns in order to show the data based on that culture without changing the computer regional settings. All columns are working find but i have issues with the GridViewExpressionColumn column because I can't set the culture for that column.
I am available to change the culture for other columns with this code.
With this code:
if (grdvPODetail == null) return;
var c1 = (GridViewDataColumn)grdvPODetail.Columns["UnitPrice"];
var c2 = (GridViewDataColumn)grdvPODetail.Columns["ERPPrice"];
if (c1 != null && c2 != null)
{
var cul = GetCultureInfoBaseOnCurrency();
// configure currency for Price
var binding = new Binding
{
Path = new PropertyPath("UnitPrice"),
StringFormat = "c",
ConverterCulture = cul
};
c1.DataMemberBinding = binding;
// configure currency for ERPPrice
var binding1 = new Binding
{
Path = new PropertyPath("ERPPrice"),
StringFormat = "c",
ConverterCulture = cul
};
c2.DataMemberBinding = binding1;
}
Any idea how to achieve what i am trying to do?
<telerik:GridViewExpressionColumn UniqueName="LineTotal"
Header="{Binding ApplicationStrings.LineTotalColumnHeader, Source={StaticResource ResourceWrapper}}"
IsFilterable="False"
IsReadOnly="True"
Expression="QtyOrd * UnitPrice"
DataFormatString="{}{0:C}"
Width="100"
DisplayIndex="6" />
My application has a dropdown box for Currencies which sets the culture the numeric columns in order to show the data based on that culture without changing the computer regional settings. All columns are working find but i have issues with the GridViewExpressionColumn column because I can't set the culture for that column.
I am available to change the culture for other columns with this code.
With this code:
if (grdvPODetail == null) return;
var c1 = (GridViewDataColumn)grdvPODetail.Columns["UnitPrice"];
var c2 = (GridViewDataColumn)grdvPODetail.Columns["ERPPrice"];
if (c1 != null && c2 != null)
{
var cul = GetCultureInfoBaseOnCurrency();
// configure currency for Price
var binding = new Binding
{
Path = new PropertyPath("UnitPrice"),
StringFormat = "c",
ConverterCulture = cul
};
c1.DataMemberBinding = binding;
// configure currency for ERPPrice
var binding1 = new Binding
{
Path = new PropertyPath("ERPPrice"),
StringFormat = "c",
ConverterCulture = cul
};
c2.DataMemberBinding = binding1;
}
Any idea how to achieve what i am trying to do?