c# - Cannot open browse in a datagridview -


i have datagridview seen in picture , openfiledialog has open when click on "browse file". believe there no way become possible if write code under button_click methods dont know under method write code. please help.

enter image description here

as far have made this: (hope helps)

string[] col2 = new string[datagridview1.rows.count];          (int = 0; < datagridview1.rows.count; i++)              if (col2[i] == "browse file...")             {                 dialogresult result2 = openfiledialog2.showdialog();                 if (result2 == dialogresult.ok)                 {                      filename = openfiledialog1.filename;                 }             } 

place code in datagridview.cellvaluechanged event. use selectedcells property find current cell, check if value "browse file...". if so, fire off openfiledialog.showdialog() call.

see documentation cellvaluechanged: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellvaluechanged.aspx


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -