• CONTEST ALERT - Experience the power of DDR5 memory with Kingston Click for details
Status
Not open for further replies.

sumigizlov

Broken In
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
 

krishnandu.sarkar

Simply a DIGITian
Staff member
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.....!!
 

vamsi360

Always confused
when you click the button the event is button_click.

When you want to fire the event on page load Page_Load
 

krishnandu.sarkar

Simply a DIGITian
Staff member
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.
 

lucifer_is_back

Journeyman
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
 
Last edited:
OP
S

sumigizlov

Broken In
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
 
Last edited:
Status
Not open for further replies.
Top Bottom