need to set a font for a gridview in asp.net
need to set a font for a gridview in asp.net
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
selvi subramanianPosted Jun 8, 2015, 7:27 AM
am getting this errror please check it
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS1061: 'System.Web.UI.WebControls.GridView' does not contain a definition for 'DefaultCellStyle' and no extension method 'DefaultCellStyle' accepting a first argument of type 'System.Web.UI.WebControls.GridView' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 36: { Line 37: Line 38: this.GridView1.DefaultCellStyle.Font = new Font("Elfring Bar Code 39 d Hb", 15); Line 39: Line 40:Source File: d:\Modified\bramandam site\barco.aspx.cs Line: 38
Version Information: Microsoft .NET Framework Version:2.0.50727.3655; ASP.NET Version:2.0.50727.3658
Upendra Pratap ShahiPosted Jun 8, 2015, 7:24 AM
selvi subramanianPosted Jun 8, 2015, 7:22 AM
this.GridView1.RowStyle.Font = new FontStyle("Elfring Bar Code 39 d Hb", 15);Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS1729: 'System.Drawing.FontStyle' does not contain a constructor that takes '2' arguments
Source Error:
Line 38: // this.GridView1.DefaultCellStyle.Font = new Font("Elfring Bar Code 39 d Hb", 15); Line 39: Line 40: this.GridView1.RowStyle.Font = new FontStyle("Elfring Bar Code 39 d Hb", 15); Line 41: Line 42: // GridView1.RowStyle.Font.Names = FontNamesConverter.StandardValuesCollection("Elfring Bar Code 39 d Hb");Source File: d:\Modified\bramandam site\barco.aspx.cs Line: 40
Upendra Pratap ShahiPosted Jun 8, 2015, 7:05 AM