I'm creating a GridView which has a balance column. Depending on the currency, I have to set its symbol to dollars or colones (my country´s currency). I'm doing good with labels, but I cant find the way to set it on the grid, only to "Mon" and "Sal" columns. A grid can have both kind of currency (if the customer have one COLONES and one DOLARS account, but just one kind per row). I dont care if i have to change to datagridview, as long as I can set the symbol. I'd really appreciate your help.
<asp:gridview id="gvMovMesActual" runat="server" AutogenerateColumns="false">
<columns>
<asp:boundfield datafield="num" headertext="Num" />
<asp:boundfield datafield="desc" headertext="Desc"/>
<asp:boundfield datafield="fec" headertext="Fec" />
<asp:boundfield datafield="mon" headertext="Mon" DataFormatString="{0:C3}" />
<asp:boundfield datafield="sal" headertext="Sal" DataFormatString="{0:C3}" />
</columns>
</asp:gridview>
Private Function setCulture (ByVal pcurrency as string) As System.IFormatProvider
Dim cultura as System.IFormatProvider
Select Case pcurrency
Case "COLONES"
cultura= CultureInfo.CreateSpecificCulture("es-CR")
Case "DOLARES"
cultura = CultureInfo.CreateSpecificCulture("en-US")
End Select
return cultura
End Function
Private Sub getMovs()
Dim ds as DataSet = New DataSet
ws = New WebserviceToBringData
ds= ws.bringsOkTheData()
if ds is not nothing then
gvMovMesActual.dataSource = ds
gvMovMesActual.DataBind()
end if
End Sub