Hi All,
I am trying to figure how I can catch click event on Link inside of DataGridViewLinkColumn. I have searched a lot and found that only suggested way it is CellContentClick event. But this event does not care about what you clicked: Link or just text in any other textbox column. You have to analyze first in which column it happens and then react accordingly. While it is Ok for most implementation I do not feel it is right. Why I can not have Link insight DatagridView with own handler attached to it? Does any guru have time to look into it?
Thanks
Nilanka DharmadasaPosted Jan 7, 2010, 5:48 AM
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == this.dataGridView1.Columns["ColName"].Index)
{
//Write code
}
}
Why you think this way is not suitble for your application?
I don't see any problem in that.
tamojitPosted Jan 7, 2010, 3:55 AM
{
try
{
string str = ((System.Windows.Forms.DataGridView)(sender)).Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
-----------
--------------------------------
-------------------------------------
-----------------------------------