469,289 Members | 2,167 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,289 developers. It's quick & easy.

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 17842
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 zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.