tags:

views:

17

answers:

1

I have a Form with a DataGridView.

RMShyperlink = new System.Windows.Forms.DataGridViewLinkColumn(); //create a link column column
dataGridView1.Columns.Add(RMShyperlink); //add to my datagrid


for(int i =0 ; i < dataGridView1.Rows.Count; i++)
{
  dataGridView1.Rows[i].Cells[0].Value = "http://localhost"; //i set the value

  //but the value is null when I inspect it
}

how can I write a value to the cell?

A: 

There has to be more information for what's causing this. If you drop a DataGridView onto a form and put this code into the Form_Load event, your code works fine.

Could there be some other setting on the DataGridView that you haven't mentioned? Are you using databinding or something else?

msergeant
@msergeant I can change values of text fields but not the cells that are in the column that has type DataGridViewLinkColumn
iterationx
I get that. I'm saying that I can't replicate your issue on my side. I pasted your code as above and did not see any problem setting the value in the link column. What are the other settings that have been set on your DataGridView?
msergeant