Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - Windows form application exception -


i application exception

   @ system.windows.forms.currencymanager.get_item(int32 index)    @ system.windows.forms.currencymanager.get_current()    @ system.windows.forms.datagridview.datagridviewdataconnection.onrowenter(datagridviewcelleventargs e)    @ system.windows.forms.datagridview.onrowenter(datagridviewcell& datagridviewcell, int32 columnindex, int32 rowindex, boolean cancreatenewrow, boolean validationfailureoccurred)    @ system.windows.forms.datagridview.setcurrentcelladdresscore(int32 columnindex, int32 rowindex, boolean setanchorcelladdress, boolean validatecurrentcell, boolean throughmouseclick)    @ system.windows.forms.datagridview.oncellmousedown(hittestinfo hti, boolean isshiftdown, boolean iscontroldown)    @ system.windows.forms.datagridview.oncellmousedown(datagridviewcellmouseeventargs e)    @ system.windows.forms.datagridview.onmousedown(mouseeventargs e)    @ system.windows.forms.control.wmmousedown(message& m, mousebuttons button, int32 clicks)    @ system.windows.forms.control.wndproc(message& m)    @ system.windows.forms.datagridview.wndproc(message& m)    @ system.windows.forms.control.controlnativewindow.onmessage(message& m)    @ system.windows.forms.control.controlnativewindow.wndproc(message& m)    @ system.windows.forms.nativewindow.debuggablecallback(intptr hwnd, int32 msg, intptr wparam, intptr lparam)    @ system.windows.forms.unsafenativemethods.dispatchmessagew(msg& msg)    @ system.windows.forms.application.componentmanager.system.windows.forms.unsafenativemethods.imsocomponentmanager.fpushmessageloop(intptr dwcomponentid, int32 reason, int32 pvloopdata)    @ system.windows.forms.application.threadcontext.runmessageloopinner(int32 reason, applicationcontext context)    @ system.windows.forms.application.threadcontext.runmessageloop(int32 reason, applicationcontext context)    @ system.windows.forms.application.run(form mainform)    @ medforms.program.main() in f:\projects\vstu\medforms\medforms\program.cs:line 18    @ system.appdomain._nexecuteassembly(runtimeassembly assembly, string[] args)    @ system.appdomain.executeassembly(string assemblyfile, evidence assemblysecurity, string[] args)    @ microsoft.visualstudio.hostingprocess.hostproc.runusersassembly()    @ system.threading.threadhelper.threadstart_context(object state)    @ system.threading.executioncontext.run(executioncontext executioncontext, contextcallback callback, object state, boolean ignoresyncctx)    @ system.threading.executioncontext.run(executioncontext executioncontext, contextcallback callback, object state)    @ system.threading.threadhelper.threadstart() 

each time when try click on datagridview.

i error message

{"index -1 not have value."} (systemindexoutofarange exception).

on row

application.run(new mainform()); 

and not able debug it. please me find can cause such problem , how can debug it?

i'm guessing have bound list empty, (or other sort of collection not generate list changed events) datagridview, , added items list.

the items add display correctly on grid, clicking on row cause exception. because underlying currencymanager reporting current row position offset of -1. stay way because list not report changes grid.

you should bind list grid if has items in begin with, or rebind when add them.

see answer this question, same problem.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -