hey guys i have a class that i defined variables like that
public string cekilis_no{ get; set; }
public string cekilis_tarihi { get; set; }
public string sayi_bir { get; set; }
public string n_iki { get; set; }
public string n_uc { get; set; }
public string n_dort { get; set; }
public string n_bes { get; set; }
public string n_alti { get; set; }
and i give their values with the datas from my database with SqlDataReader and i show them by datagridview in my form..but my problem is that the headers shown as i wrote in my class like n_bes,n_alti, like here..how i can show it like Number 5 or Number 6 ??
Loading
CrishPosted Dec 10, 2010, 5:39 AM
You can refer this code to solve the issue of changing datagridview header text.
Madhu KPosted Dec 10, 2010, 2:07 AM
Erdinc KolukisaPosted Dec 9, 2010, 9:16 AM
cmn.HeaderText = "Kolon"+count.ToString();
and i tried something like that also
dataGridView1.Columns[1].HeaderText = "Çekilis Tarihi";
it gives the result as i wish but i thought i can rename columns while i am selecting in Sql like below
Select id, cekilis_no[ÇekiliS No], cekilis_tarihi[Çekilis Tarihi], num1[Birinci Say], num2[kinci Say],num3[nc Say], num4[Drdnc Say], num5[Beinci Say], num6[Altnc Say] From NumaraBilgileri
Madhu KPosted Dec 9, 2010, 8:47 AM
Erdinc KolukisaPosted Dec 9, 2010, 8:42 AM
Madhu KPosted Dec 9, 2010, 8:34 AM
int count = 1;
foreach (DataGridViewColumn cmn in dataGridView1.Columns)
{
cmn.HeaderText = count.ToString();
count++;
}