In infragistics webdatagrid, I had defined BoundDataField like below to display currency symbol. In case the value is negative, it displays value in bracket rather then displaying minus(-) symbol. How can I display minus sign rather then bracket for negative value?
Since the above suggestion didn't work, so I had done it like below.
In .ascx, defined the field inside webdatagrid as under:
<ig:UnboundField Header-Text="Cash Received" Key="Cash Received"></ig:UnboundField>
Inside InitializeRow event defined it like below:
protected void WebDataGrid1_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e)
{
if(e.Row.DataItem !=null)
Client cln=e.Row.DataItem as Client;
if(cln.CashRec < 0)
String strCR = cln.CashRec.ToString("f2"); //Two places of decimal
e.Row.Items[4].Value= string.Format("-${0}", strCR.Substring(1, strCR.Length -1)); //Added minus sign & Dollar symbol
}
else
e.Row.Items[4].Value= string.Format("${0}",cln.CashRec); //Added Dollar symbol
Hello Birendra,
I suspect the problem is due to your master page overriding the culture settings in your content pages.
I suggest you implement InitializeCulture() in your BasePage class and set it to your preferred local settings.
For additional information you can check out this thread
Feel free to contact me for further assistance.
Admin, please don't 'Mark as answer' since my issue is not resolved by the suggestion mentioned.
Thanks Radoslav for replying. I had applied the same on Master page but it didnot worked for grid present in ContentPage.
Thank you for contacting Infragistics Developer Support!
You should try setting EnableScriptGlobalization and EnableScriptLocalization off the ScriptManager to True.
For example:
<ig:WebScriptManager id="sm" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true"></ig:WebScriptManager>