c# - Why GridView.SelectRow is not working in Devexpress? -


i using devexpress gridcontrol. when try add new row or select row gridcontrol, it's not working.

gridcontrolmultifiltervalues.addnewrow(); 

it throws error message below

grid control not contain definition addnewrow , no extension method addnewrow

note : tried selectrow() method also. not working

update

filtervalues column name of gridcontrol. have created column run designer.

(gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).addnewrow(); int newrowhandle = (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).focusedrowhandle;  (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).setrowcellvalue(newrowhandle, "filtervalues", "3rd party %");  (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).updatecurrentrow(); (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).refreshdata(); 

your error message indicates trying perform addnewrow , selectrow methods on gridcontrol, not gridview.

when drag gridcontrol vs toolbox onto form, gridcontrol , gridview created. gridcontrol control holds multiple gridview (see: view technology).

this tells me gridcontrol named gridviewfields. gridview total separate class containing methods want invoke. default, named gridview1 when new gridcontrol added form. can cast gridcontrol's mainview property instance of gridview @ runtime:

(gridviewfields.mainview devexpress.xtragrid.views.grid.gridview).addnewrow(); 

note of properties , methods use regards devexpress gridcontrol members of view, not gridcontrol.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -