Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
AnswerRe: SetPixel on Controls Pin
Richard MacCutchan26-Dec-15 22:09
mveRichard MacCutchan26-Dec-15 22:09 
AnswerRe: SetPixel on Controls Pin
OriginalGriff26-Dec-15 22:14
mveOriginalGriff26-Dec-15 22:14 
AnswerRe: SetPixel on Controls Pin
Dave Kreskowiak27-Dec-15 11:04
mveDave Kreskowiak27-Dec-15 11:04 
AnswerRe: SetPixel on Controls Pin
BillWoodruff27-Dec-15 22:19
professionalBillWoodruff27-Dec-15 22:19 
AnswerRe: SetPixel on Controls Pin
John Torjo28-Dec-15 0:05
professionalJohn Torjo28-Dec-15 0:05 
QuestionHow can I replace all text in a listBox1 that matches "some text " with "other text "? Pin
Member 1041097226-Dec-15 8:41
Member 1041097226-Dec-15 8:41 
AnswerRe: How can I replace all text in a listBox1 that matches "some text " with "other text "? Pin
BillWoodruff26-Dec-15 9:46
professionalBillWoodruff26-Dec-15 9:46 
QuestionDynamic Treeview using C# Pin
Member 1124005623-Dec-15 19:49
Member 1124005623-Dec-15 19:49 
I am dynamically binding a tree-view.I have multiple root nodes and multiple child nodes.OnSelectedNodeChanged event is firing only for childnodes of first root node.If I click on child nodes of second root node,i am getting root node value only in Treeview.Selectednode.Text. Can anyone help?this is my code..

this is my code..

C#
private void FillCategories(string item, TreeNode parent)
    {
        string[] category1 = item.Split(',');
        TreeNode tnParent = new TreeNode();
        tnParent.Text = category1[1];
        tnParent.Value = category1[0];
        tnParent.ToolTip = category1[1];
        tnParent.SelectAction = TreeNodeSelectAction.SelectExpand;
        tnParent.CollapseAll();
        tnParent.Selected = true;
        parent.ChildNodes.Add(tnParent);
        FillMetadata(tnParent, tnParent.Value);
    }

    private void FillMetadata(TreeNode parent, string categoryId)
    {
        DataSet ds = PDataset("SELECT MetadataID,MetadataName FROM Metadata WHERE MetadataID IN (SELECT MetadataID FROM CategoryMetadata WHERE CategoryID =" + categoryId + ") and ParentMetadataID IS NULL");
        parent.ChildNodes.Clear();
        foreach (DataRow dr1 in ds.Tables[0].Rows)
        {
            TreeNode child = new TreeNode();
            child.Text = dr1["MetadataName"].ToString().Trim();
            child.Value = dr1["MetaDataID"].ToString().Trim();
            child.ToolTip = child.Text;
            child.SelectAction = TreeNodeSelectAction.Select;
            child.CollapseAll();
            parent.ChildNodes.Add(child);
            FillSubMetadata(child, child.Value);
        }
    }

private void FillSubMetadata(TreeNode child, string metadataId)
    {
        DataSet ds = PDataset("SELECT MetadataID,MetadataName FROM Metadata WHERE ParentMetadataID =" + metadataId + " ");
        child.ChildNodes.Clear();
        foreach (DataRow dr1 in ds.Tables[0].Rows)
        {
            TreeNode subchild = new TreeNode();
            subchild.Text = dr1["MetadataName"].ToString().Trim();
            subchild.Value = dr1["MetaDataID"].ToString().Trim();
            subchild.ToolTip = subchild.Text;
            subchild.SelectAction = TreeNodeSelectAction.Select;
            subchild.CollapseAll();
            child.ChildNodes.Add(subchild);
        }
    }

SuggestionRe: Dynamic Treeview using C# Pin
CHill6023-Dec-15 23:14
mveCHill6023-Dec-15 23:14 
SuggestionRe: Dynamic Treeview using C# Pin
Richard Deeming4-Jan-16 3:26
mveRichard Deeming4-Jan-16 3:26 
QuestionCountdown timer Pin
Enzotech223-Dec-15 11:05
Enzotech223-Dec-15 11:05 
AnswerRe: Countdown timer Pin
Richard MacCutchan23-Dec-15 11:14
mveRichard MacCutchan23-Dec-15 11:14 
QuestionHow do I read data from USB Virtual COM in C#? Pin
naouf1023-Dec-15 3:27
naouf1023-Dec-15 3:27 
AnswerRe: How do I read data from USB Virtual COM in C#? Pin
OriginalGriff23-Dec-15 3:55
mveOriginalGriff23-Dec-15 3:55 
GeneralRe: How do I read data from USB Virtual COM in C#? Pin
naouf1023-Dec-15 11:41
naouf1023-Dec-15 11:41 
AnswerRe: How do I read data from USB Virtual COM in C#? Pin
Gerry Schmitz23-Dec-15 11:07
mveGerry Schmitz23-Dec-15 11:07 
GeneralRe: How do I read data from USB Virtual COM in C#? Pin
naouf1023-Dec-15 11:39
naouf1023-Dec-15 11:39 
AnswerRe: How do I read data from USB Virtual COM in C#? Pin
OriginalGriff23-Dec-15 11:57
mveOriginalGriff23-Dec-15 11:57 
GeneralRe: How do I read data from USB Virtual COM in C#? Pin
naouf1023-Dec-15 14:30
naouf1023-Dec-15 14:30 
GeneralRe: How do I read data from USB Virtual COM in C#? Pin
Gerry Schmitz23-Dec-15 12:05
mveGerry Schmitz23-Dec-15 12:05 
GeneralRe: How do I read data from USB Virtual COM in C#? Pin
naouf1023-Dec-15 14:45
naouf1023-Dec-15 14:45 
GeneralRe: How do I read data from USB Virtual COM in C#? Pin
Gerry Schmitz23-Dec-15 16:11
mveGerry Schmitz23-Dec-15 16:11 
AnswerRe: How do I read data from USB Virtual COM in C#? Pin
Luc Pattyn23-Dec-15 17:24
sitebuilderLuc Pattyn23-Dec-15 17:24 
GeneralRe: How do I read data from USB Virtual COM in C#? Pin
naouf1026-Dec-15 3:44
naouf1026-Dec-15 3:44 
GeneralRe: How do I read data from USB Virtual COM in C#? Pin
Agent__00730-Dec-15 15:45
professionalAgent__00730-Dec-15 15:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.