Click here to Skip to main content
15,888,010 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to make a single row of data grid view bold, but i don't know how can i do. please help.

i try below line but it's not working.

C#
dgvRIM.Rows[4].Cells[2].Style.font= new font("Arial",10,fontStyle.Bold);



and
C#
dgvRIM.Rows[4].DefaultCellStyle.font= new font("Arial",10,fontStyle.Bold);



but this not working please help.
Posted
Updated 12-Jun-14 4:01am
v2
Comments
BulletVictim 12-Jun-14 9:19am    
What ios this for? WinForms, asp.net, etc...?
On winforms I used the following and it worked fine.
DGVSalesDetails.Rows[1].DefaultCellStyle.Font = new Font("Arial", 10, FontStyle.Bold);

1 solution

Try this

C#
protected void GridView1_DataBound(object sender, EventArgs e)
{
    GridView1.Rows[0].Style.Add(HtmlTextWriterStyle.FontWeight, "Bold");
}
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900