954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

adding link column to datagridview(windows application)

I am able to add a link to a datagridview but the problem is I want all the links with same name. But I am getting the name from database data

DataGridViewLinkColumn linkColumn = new DataGridViewLinkColumn();
            linkColumn.Text = "View";
            linkColumn.HeaderText = "View";
            linkColumn.Name = "View";
            linkColumn.DataPropertyName = "PART_NO";

This PART_NO is coming from database I want to change it to some text like "view".

can anyone help me...

creativehacker
Light Poster
29 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

Try setting the DataPropertyName first, not last.

LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
 

setting datapropertyname first is not making any difference..

creativehacker
Light Poster
29 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

Works for me

DataGridViewLinkColumn dl = new DataGridViewLinkColumn();
                dl.DataPropertyName="Status";
                dl.Name = "LIZ";
                dataGridView1.Columns.Add(dl);


So, something else is causing yours to overwrite the column.

LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You