|
Hi everybody.
I'm new here and I have a big problem.
I have a DataGridView, filled manual. With a click you can edit the cells. After the editing, i clear the dgv and fill it with the new data. and the method datagridview1.rows.clear() this error appears:
System.InvalidOperationException wurde nicht behandelt.
Message="Der Vorgang ist ungültig, da er einen Wiedereintrittsaufruf an die SetCurrentCellAddressCore-Funktion zur Folge hat."
Source="System.Windows.Forms"
StackTrace:
bei System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
bei System.Windows.Forms.DataGridView.set_CurrentCell(DataGridViewCell value)
bei Administration.Form1.NewsEinlesen() in D:\schule\_Maturaprojekt\Administrationstool\Administration\Administration\Form1.cs:Zeile 91.
bei Administration.Form1.dataGridView1_CellEndEdit_1(Object sender, DataGridViewCellEventArgs e) in D:\schule\_Maturaprojekt\Administrationstool\Administration\Administration\Form1.cs:Zeile 552.
bei System.Windows.Forms.DataGridView.OnCellEndEdit(DataGridViewCellEventArgs e)
bei System.Windows.Forms.DataGridView.EndEdit(DataGridViewDataErrorContexts context, DataGridViewValidateCellInternal validateCell, Boolean fireCellLeave, Boolean fireCellEnter, Boolean fireRowLeave, Boolean fireRowEnter, Boolean fireLeave, Boolean keepFocus, Boolean resetCurrentCell, Boolean resetAnchorCell)
bei System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
bei System.Windows.Forms.DataGridView.OnCellMouseDown(HitTestInfo hti, Boolean isShiftDown, Boolean isControlDown)
bei System.Windows.Forms.DataGridView.OnCellMouseDown(DataGridViewCellMouseEventArgs e)
bei System.Windows.Forms.DataGridView.OnMouseDown(MouseEventArgs e)
bei System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.DataGridView.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei Administration.Program.Main() in D:\schule\_Maturaprojekt\Administrationstool\Administration\Administration\Program.cs:Zeile 17.
bei System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
When you finish the editing with enter, the changes are automatically saved. This works fine, only when you click into another cell without finishing i get this error.
thx if anybody can help me.
|
|
|
|
|
Good People,
What is the C# equivalent of C++ STL Vectors?
Thanks,
BP
|
|
|
|
|
My C++ is a little rusty but I believe Dictionary<> would be close. Although you might find something better here Power Collections for .NET[^]
only two letters away from being an asset
|
|
|
|
|
System.Collections.Generic.List<T> makes the same job as the std::vector<T>
System.Collections.Generic.Dictionary<TKey, TValue> makes the same job as std::map<TKey, TValue>
Kind regards
Simon
|
|
|
|
|
Hi,
I am facing a problem. I have one tabcontrol,but i dint't add any tabpage on it.Now,i would like to add a tooltips in the tabcontrol(In my situation,i need to create it and add it at runtime). I have try to create a new tab page (in run time),then create a tooltip control(in runtime),and try to add the tooltip into that tabpage,but i cant make it.Below is my some coding:
TabPage newTab = new TabPage();<br />
ToolTip tooltip = new ToolTip();<br />
newTab.Controls.Add(tooltip);<br />
tabControlChart.Controls.Add(newTab);
I was get this error:
1)The best overloaded method match for 'System.Windows.Forms.Control.ControlCollection.Add(System.Windows.Forms.Control)' has some invalid arguments
2)Argument '1': cannot convert from 'System.Windows.Forms.ToolTip' to 'System.Windows.Forms.Control
My question is,how can i add the tooltip control(at runtime) into a tabpage?
can anyone guide me on this problme?
Thanks in advance,
cocoonwls
|
|
|
|
|
Hello,
tooltip.SetToolTip(newTab, "youre text");
All the best,
Martin
|
|
|
|
|
hi,
Thank you for your help hand,i got it
cocoonwls
|
|
|
|
|
|
Hello,
Use the SelectedItem property, for example in the SelectedIndexChanged event:
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
string test = comboBox1.SelectedItem.ToString();
}
All the best,
Martin
|
|
|
|
|
comboBox1.SelectedIndex ?
|
|
|
|
|
If I read your question correctly, SelectedValue is what you want.
A simple test is place 2 labels on the form, and on the Change event populate them with the selectedValue and selectedIndex values. If the index label gets populated, and not the value, you know there is something wrong with your query.
|
|
|
|
|
hi,
is there any event that let me know when the textbox has focus and when it looses focus? i remember in java there was something like that maybe called onFocus or something like that.
thanks
|
|
|
|
|
Hello,
Look at GotFocus and LostFocus Event.
All the best,
Martin
|
|
|
|
|
I didn't know that there is some events that are not displayed in the properties panel that shows in the designer view.
but why is that??
thanks any way
|
|
|
|
|
MouseClick Event
private void textBox1_MouseClick(object sender, MouseEventArgs e)
|
|
|
|
|
|
Hello,
It is somehow descriped as a focus-event of a lower layer. (don't know what that means exactly)
Instead the Enter and Leave events are recomended.
All the best,
Martin
|
|
|
|
|
I want to activate the program that will capture screen as vdo streaming when I start my program.
This capture program will be activated by pressing F9. So now I'm using
Sendkeys("{F9}");
When the form loaded. But this F9 pressing event was sent to my application only.
How to make it global?
I cannot call or change focus to screen capture program because I want it to be transparant to user.
|
|
|
|
|
checkout this vb.net code...
http://sharma.hariomprakash.googlepages.com/WindowsApplication1.rar
Lxcite's Planet
... the ultimate solution
|
|
|
|
|
How to get an IP Address from registry in windows XP.
|
|
|
|
|
What IP address? Your own?
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Yes, my own computer IP address.
|
|
|
|
|
This[^] should help.
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Your IP address is not stored in the registry.
|
|
|
|
|
I need to start a console application without showing the console. Can anyone help???
The reason I want to do this is that I have a windows application that I want to be able to either run as a straight application but also from the command prompt. I want to have a switch "/?" that displays on the console, help for the command prompt syntax. To do this you have set up the windows project output type to the console. BUT I want to then be able to run the window straight from windows without showing this console at startup.
In essence, I have a console application that displays a form. I need to be able to run it from windows without bringing up a console window.
Thanks,
Tim
|
|
|
|
|