我想清除數據網格視圖而不刪除列設置。一欄是DataGridViewComboBoxColumn。我使用以下代碼:gridNomiColonne.Rows.Clear();gridNomiColonne.Columns.Clear();我收到以下錯誤:"Cannot delete data" ( System.ArgumentExceptionHResult=0x80070057Messaggio=Impossibile cancellare questo elenco.Origine=System.DataAnalisi dello stack:in System.Data.DataView.System.Collections.IList.Clear()in System.Windows.Forms.BindingSource.Clear()in System.Windows.Forms.DataGridViewRowCollection.Clear()in ContabImporterf.MainForm.btnCarica_Click(Object sender, EventArgs e) inC:\Users\Utente\Documents\Visual Studio 2017\Projects\ContabImporterf\ContabImporterf\MainForm.cs: riga 200in System.Windows.Forms.Control.OnClick(EventArgs e)in System.Windows.Forms.Button.OnClick(EventArgs e)in System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)in System.Windows.Forms.Control.WndProc(Message& m)in System.Windows.Forms.ButtonBase.WndProc(Message& m)in System.Windows.Forms.Button.WndProc(Message& m)in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32msg, IntPtr wparam, IntPtr lparam)in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)in Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNaiiveMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32reason, Int32 pvLoopData)in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32reason, ApplicationContext context)in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)in System.Windows.Forms.Application.Run(Form mainForm)in ContabImporterf.Program.Main() in C:\Users\Utente\Documents\Visual Studio2017\Projects\ContabImporterf\ContabImporterf\Program.cs: riga 19 )有任何想法嗎?
DatagridView:無法刪除行
慕田峪7331174
2021-04-27 16:12:37