i was trying to add a button column to the windows forms datagridview but i do not know the event that will be fired on clicking the button in asp it is the item command event but there is no such event in windows form datagridview
please help
As far i know button_click event will b fired. But for that u need to write the gridview_rowcommand event for that button.
May b I'm wrong. I'm not so sure. I forgot.....!!
but in case of windows forms datagridview RowCommand is not available it is only available in asp.net
when you click the button the event is button_click.
When you want to fire the event on page load Page_Load
i am not asking for regular buttons i am asking for datagridview button column
Ya RowCommand is available in ASP.NET. U r in Windows......Sorry I didn't noticed.
So what r u asking? The ques is not clear not even now. As u said what will b the event in ASP.
yes in asp it is rowcommand but i am asking for windows form
Handle the CellContentClick event of the DataGridView.
Evaluate DataGridView.Columns(e.ColumnIndex).Name to get the name of the column clicked
If it's your button column, then you can get the value of any cell in that row with
DataGridView.CurrentRow.Cells["ColumnNameHere"].Value
thanks lucifer_is_back your suggestion worked like a charm
but there is still one glitch the first time i click the button it works perfectly but on subsequent click it has no effect
*msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcellvalueeventargs(VS.85).aspx