472,131 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,131 software developers and data experts.

Cannot implicitly convert to 'System.Windows.Forms.ColumnHeader'

hi all
i m creating a window application and i used a listview control in a window's form. But when i try to build that application then the following error prompts :

Cannot implicitly convert type 'string' to 'System.Windows.Forms.ColumnHeader'

i m not able the understand what is the problem.
Feb 15 '07 #1
3 18330
hi all
i m creating a window application and i used a listview control in a window's form. But when i try to build that application then the following error prompts :

Cannot implicitly convert type 'string' to 'System.Windows.Forms.ColumnHeader'

i m not able the understand what is the problem.
I had the same problem. One of my columns was named "Name". I changed it to "Name_col" and the problem disappeared. Using "Name" conflicted with an existing member.
Apr 2 '07 #2
SammyB
807 Expert 512MB
hi all
i m creating a window application and i used a listview control in a window's form. But when i try to build that application then the following error prompts :

Cannot implicitly convert type 'string' to 'System.Windows.Forms.ColumnHeader'

i m not able the understand what is the problem.
Please show us the line of code and several lines before & after. It sounds like you just need to use the Text property.
columnHeader1 = "Desc" would give you that error. Use
columnHeader1.Text = "Desc"
Apr 2 '07 #3
Wint
1
Please show us the line of code and several lines before & after. It sounds like you just need to use the Text property.
columnHeader1 = "Desc" would give you that error. Use
columnHeader1.Text = "Desc"
I got this error too, it was choking on the this.name = "frmMain"; line when initializing the windows form. Turns out a control inside that form, a ListView, had a column that I had named "Name". Changing that to something else allowed the project to build without errors. Any idea why?
Mar 1 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

22 posts views Thread by Christoph Boget | last post: by
6 posts views Thread by juli | last post: by
9 posts views Thread by Andy Sutorius | last post: by
7 posts views Thread by Alex | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.