我有一个带有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
}如何向单元格写入值?
发布于 2010-09-23 04:12:22
必须有更多的信息来解释是什么导致了这种情况。如果您将一个DataGridView放到一个窗体上,并将此代码放入Form_Load事件中,您的代码就可以正常工作。
DataGridView上有没有你没有提到的其他设置?你是在使用数据绑定还是别的什么?
https://stackoverflow.com/questions/3772757
复制相似问题