Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 11-11-2009, 11:08 PM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2006
Posts: 45
Default c# problem


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
sumigizlov is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 11-11-2009, 11:14 PM   #2 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default Re: c# problem

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.....!!
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is offline  
Old 11-11-2009, 11:50 PM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2006
Posts: 45
Default Re: c# problem

but in case of windows forms datagridview RowCommand is not available it is only available in asp.net
sumigizlov is offline  
Old 11-11-2009, 11:51 PM   #4 (permalink)
Always confused
 
vamsi360's Avatar
 
Join Date: May 2008
Location: Mandriva Control Center
Posts: 349
Default Re: c# problem

when you click the button the event is button_click.

When you want to fire the event on page load Page_Load
__________________
Vamsi Subhash
visit my blog at www.vamsisubhash.co.cc and taste a bit of IT!
vamsi360 is offline  
Old 11-11-2009, 11:53 PM   #5 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2006
Posts: 45
Default Re: c# problem

i am not asking for regular buttons i am asking for datagridview button column
sumigizlov is offline  
Old 11-11-2009, 11:56 PM   #6 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default Re: c# problem

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.
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is offline  
Old 12-11-2009, 12:01 AM   #7 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2006
Posts: 45
Default Re: c# problem

yes in asp it is rowcommand but i am asking for windows form
sumigizlov is offline  
Old 12-11-2009, 12:35 PM   #8 (permalink)
Broken In
 
Join Date: Oct 2008
Posts: 133
Default Re: c# problem

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 by lucifer_is_back; 12-11-2009 at 12:47 PM.
lucifer_is_back is offline  
Old 12-11-2009, 01:02 PM   #9 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2006
Posts: 45
Default Re: c# problem

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 by sumigizlov; 16-11-2009 at 03:25 PM.
sumigizlov is offline  
Old 13-11-2009, 08:39 PM   #10 (permalink)
Always confused
 
vamsi360's Avatar
 
Join Date: May 2008
Location: Mandriva Control Center
Posts: 349
Smile Re: c# problem

http://msdn.microsoft.com/en-us/libr...gs(VS.85).aspx
__________________
Vamsi Subhash
visit my blog at www.vamsisubhash.co.cc and taste a bit of IT!
vamsi360 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Pinnacle PCTV-Stereo puttu Hardware Q&A 4 15-06-2007 05:40 PM
hdd weird problem... i bet nobody has this problem vish786 Hardware Q&A 16 11-06-2007 08:21 PM
BIG BIG hardware problem... Please help... Very Urgent... go4saket QnA (read only) 21 13-01-2006 12:00 AM
Problem With My Monitor and UPS navino87 Hardware Q&A 7 08-01-2006 11:40 AM

 
Latest Threads
- by Charan
- by Charan
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 03:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2