Link to home
Start Free TrialLog in
Avatar of Dov_B
Dov_B

asked on

Can I have a different font for different columns in a datagrid in vb.net 2003

I have a database with words in one language in one column and and the same word translated in the next column
I would like to display the columns in different language fonts How can I do this
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Sample of Itay...

Place this code with each column code

' Create a new CultureInfo object using the
' the locale ID for Italy.
Dim ItalyCultureInfo As Globalization.CultureInfo = New _
Globalization.CultureInfo(&H410)
' Cast a column that holds numeric values to the
' DataGridTextBoxColumn type, and set the FormatInfo
' property to the new CultureInfo object.
Dim myGridTextBoxColumn As DataGridTextBoxColumn = _
CType(MyDataGrid.TableStyles("Orders"). _
GridColumnStyles("OrderAmount"), DataGridTextBoxColumn)
myGridTextBoxColumn.FormatInfo = ItalyCultureInfo
myGridTextBoxColumn.Format = "c"
Avatar of Dov_B
Dov_B

ASKER

I dont know what you mean by each column code all columns are populated in one shot
with the following
DataGrid1.SetDataBinding(ds, "t1")
 
ASKER CERTIFIED SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dov_B

ASKER

woah
gee thanks
this is going to take me time to digest

but at first glance I only see you setting the font property for the entire table and not for the individual columns is there anything simple like

datagrid1.column(1).font="arial"

thanks in advance for your patience
please remember I am real new at this
the 'Globalization.CultureInfo'  is where you get the different font languages
the font can stay the same in the table, but you can have different languages in each column.
Avatar of Dov_B

ASKER

ok I copied all your code into my project
it is not working
I dont have any squiggly lines under any of the members or objects except for Itag
the variable you did the select case on
also my table only has 2 columns in it does that make a difference
finaly do I need to set the language can't I just set the font
my language either
         actualy uses an english font wich just looks different

         or uses a unicode font
Can you post  your code and what font/langauage you want.