hi, you forgot the a counter if all cols in a row are equal to the ones in rowx? in this case you would delete the row always if the last col is equal. Maybe thats it? cu
User 9609290
Posts
-
Compare rows of a datagridview and remove repeated rows -
No scrollbars when executing program on another PC [Solved]Hi, Ive got a Treeview with scrollable enabled. On my developing PC everything works fine. When i resize my window, the scrollbar appears. But when I run the .exe on another PC (even when its installed by an setup installer), there are no scrollbars! I've tried on 3 different PCs. All PCs are using Windows 7 and the required .Net4 is installed. I dont know whats the problem. Everything else works :). Please help. Edit: Okay, the Problem appears when i use the treeview in a SplitContainer. Is this a know issue and is there a workaround? i really need those splitcontainers. Edit: Got it! Each Element within a splitcontainer panel has to have the dock property set to "Fill". Now it works :). Any ideas? Thanks
-
Passing object between event handlers?this doesnt work (I've tried). Because the "static" is needed so the class doesnt loose the object after the first call (as far as i understand :D)
-
Passing object between event handlers?As I said, it was obvious ^^ thank you for the hint. Just needed a static object (that was the point) where I have to "set" the object at first deserialize and afterwards i can "get" it from there...
public class xmlReadWrite { static private object \_xmlData; public object getXmlData() { return \_xmlData; } public void setXmlData(object xmlData) { \_xmlData= xmlData; } }
-
Passing object between event handlers?Hi all, im new to C# (coming from matlab), and so theres a lot to explore for me (the whole OOP thing ;) ). Currently I write a simple program which deserializes a xml file (on a menu click) and shows the xml structure in a treeview. My Problem: When clicking on an element of the treeview, i want to show the content of the chosen xml field in a datagrid. This means I have to make the deserialized xml (which is an object) avaialable for the treeView1_AfterSelect. Maybe someone has a hint for me? I already searched for a solutions which fits this problem :). Maybe its to obvious ^^? Here's some code (im very new to OOP so dont laugh :D).
...
private void loadObjectsToolStripMenuItem\_Click(object sender, EventArgs e) {
// get xml File
string FilePath = string.Empty;OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "xml files (\*.xml)|\*.xml| All files (\*.\*)|\*.\*"; openFileDialog1.InitialDirectory = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Application.ExecutablePath), @""); if (openFileDialog1.ShowDialog() == DialogResult.OK) FilePath = openFileDialog1.FileName;
// deserialize xml file, so i have an object
xmlDataThings xmlData= (xmlDataThings )xmlReadWrite.DeSerializeFromXML(FilePath, typeof(xmlDataThings ));//create treeview and add nodes (works fine)
TreeNode tNode = new TreeNode(openFileDialog1.SafeFileName);if (treeViewObjects.Nodes.ContainsKey(openFileDialog1.SafeFileName)) return; tNode.Name = openFileDialog1.SafeFileName; treeViewObjects.Nodes.Add(tNode); tNode = treeViewObjects.Nodes\[treeViewObjects.Nodes.Count-1\]; AddNode(xmlData, tNode); treeViewObjects.ExpandAll(); }
// !!!!!!!! Want to have the xmlData in here HELP :D !!!!!!
private void treeViewObjects_AfterSelect(object sender, TreeViewEventArgs e)
{
if (treeViewObjects.SelectedNode.Level == 2)
{// please xmlData, come in here RIGHT HERE!!!!!! }
...
}Would be very nice if someone has a hint for me.