Click here to Skip to main content
13,551,455 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


17 bookmarked
Posted 20 Sep 2008
Licenced CPOL

How to Make an Arabic Column in DataGridView

, 20 Sep 2008
Rate this:
Please Sign up or sign in to vote.
Arabic Column in DataGridView


Some people make applications that have an Arabic Interface. We cannot name any column in Arabic in any RDBMS, however DataGridView can solve this problem by giving an Arabic name to your column when you display your data.

Using the Code

There are two ways to make an Arabic column in DataGridView.

The first way is very easy and can be done by changing the header text of DataGridView as follows:

dataGridView1.Columns[0].HeaderText = "???????";

dataGridView1.Columns[1].HeaderText = "?????";

dataGridView1.Columns[2].HeaderText = "?????";

The second way is that DataGridViewTextBoxColumn is used to host cells that enable displaying and editing of text strings.


  1. Create an instance from DataGridViewTextBoxColumn class

  2. Add cells you created to be hosted in dataGridView1:

    dataGridView1.Columns.AddRange(new DataGridViewTextBoxColumn[] {
  3. Ok, after you add cells to dataGridView, you want to make a link between the cell which you write Arabic text on and the column:

    idDataGridViewTextBoxColumn.DataPropertyName = "id";
    idDataGridViewTextBoxColumn.HeaderText = "?";


DataGridViewTextBoxColumn idDataGridViewTextBoxColumn;
DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
DataGridViewTextBoxColumn ageDataGridViewTextBoxColumn;

private void Form1_Load(object sender, EventArgs e)
    idDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
    nameDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
    ageDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();

    dataGridView1.Columns.AddRange(new DataGridViewTextBoxColumn[] {

        using (SqlConnection sqlCon = new SqlConnection(
            @"Data Source=.\SQLEXPRESS;AttachDbFilename=" +
            "C:\Documents and Settings\Administrator\My Documents\AhmedRabie.mdf;" +
            "Integrated Security=True;Connect Timeout=30;User Instance=True"))
            SqlCommand cmd = sqlCon.CreateCommand();
            cmd.CommandText = "Select * from StudentInfo";
            SqlDataAdapter adapter = new SqlDataAdapter();
            adapter.SelectCommand = cmd;
            DataSet dset = new DataSet();

            idDataGridViewTextBoxColumn.DataPropertyName = "id";
            idDataGridViewTextBoxColumn.HeaderText = "?";
            idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn";
            // nameDataGridViewTextBoxColumn
            nameDataGridViewTextBoxColumn.DataPropertyName = "name";
            nameDataGridViewTextBoxColumn.HeaderText = "?????";
            nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
            // ageDataGridViewTextBoxColumn
            ageDataGridViewTextBoxColumn.DataPropertyName = "age";
            ageDataGridViewTextBoxColumn.HeaderText = "?????";
            ageDataGridViewTextBoxColumn.Name = "ageDataGridViewTextBoxColumn";

            dataGridView1.DataSource = dset.Tables[0];


  • 20th September, 2008: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Ahmed R El Bohoty
Web Developer ITeShare
Egypt Egypt
I am interested in Software architecture, Requirements Engineering and coding. I am MCP ,SCJP,MCTs,MCPD, Brainbench.

You may also be interested in...

Comments and Discussions

GeneralDatagridview Pin
Saad_ang4-May-11 4:43
memberSaad_ang4-May-11 4:43 
GeneralMy vote of 1 Pin
Mohm'ed Melhem3-Aug-09 2:20
memberMohm'ed Melhem3-Aug-09 2:20 
Questionand how can we do following Pin
sairfan121-Nov-08 21:56
membersairfan121-Nov-08 21:56 
Generalالف شكر يا حمد Pin
egyptionyouth3-Oct-08 18:45
memberegyptionyouth3-Oct-08 18:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02-2016 | 2.8.180515.1 | Last Updated 20 Sep 2008
Article Copyright 2008 by Ahmed R El Bohoty
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid