Click here to Skip to main content
15,885,936 members
Home / Discussions / C#
   

C#

 
QuestionAny **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
SledgeHammer019-Sep-14 18:16
SledgeHammer019-Sep-14 18:16 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
PIEBALDconsult9-Sep-14 19:42
mvePIEBALDconsult9-Sep-14 19:42 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
SledgeHammer019-Sep-14 20:07
SledgeHammer019-Sep-14 20:07 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
Pete O'Hanlon9-Sep-14 20:46
mvePete O'Hanlon9-Sep-14 20:46 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
SledgeHammer0110-Sep-14 6:46
SledgeHammer0110-Sep-14 6:46 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
PIEBALDconsult10-Sep-14 3:14
mvePIEBALDconsult10-Sep-14 3:14 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
SledgeHammer0110-Sep-14 6:42
SledgeHammer0110-Sep-14 6:42 
Questionadd row to datagridview by checking child node check box of treeview Pin
Member 110597999-Sep-14 15:39
Member 110597999-Sep-14 15:39 
I'm new to C# and am working on first project.

I have a WINFORM that displays a treenode and a datagridview. I want selected items from the treenode to go to the datagridview. If I select the parent node of treenode all children go to datagridview but if I just expand the parent and select one of the children, nothing goes to datagrid. (selection of a treenode fires a method to get attributes of the item from sql table and it is the attributes that go to the grid + node value)

When parent is selected 'if (e.Node.Nodes.Count > 0)' is true. When parent isn't selected but child is 'if (e.Node.Nodes.Count > 0)' is false.

So my question is what code do I need to find child nodes that are checked/unchecked?

Once I get correct code to find child node check, what code moves it to datagrid or delete from datagrid if child is unchecked?



C#
private void getChildNodesToGrid()
 {
     // get all child nodes add to dataGridView
     DataTable dt = getFieldsTable();
     dgvColumns.DataSource = dt;
     getAttributeSIDs();
 }


C#
private void tvFileMan_AfterCheck(object sender, TreeViewEventArgs e)
    {
        getFileAndColumns();
        if (e.Node.Nodes.Count > 0)
        {
           this.CheckAllChildNodes(e.Node, e.Node.Checked);
            // Checked a file so get fields and check all fields except subfiles.
            // Use this event handler to process actions from check box click
            e.Node.Expand();
            foreach (TreeNode tn in e.Node.Nodes)
            {
                if (tn.Nodes.Count.Equals(0))
                    tn.Checked = e.Node.Checked;
            }
            getChildNodesToGrid();
 }  

AnswerRe: add row to datagridview by checking child node check box of treeview Pin
Member 1105979911-Sep-14 7:55
Member 1105979911-Sep-14 7:55 
QuestionChat Application Pin
Kevin Marois9-Sep-14 11:23
professionalKevin Marois9-Sep-14 11:23 
AnswerRe: Chat Application Pin
Ravi Bhavnani9-Sep-14 11:36
professionalRavi Bhavnani9-Sep-14 11:36 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 11:37
professionalKevin Marois9-Sep-14 11:37 
GeneralRe: Chat Application Pin
Ravi Bhavnani9-Sep-14 11:39
professionalRavi Bhavnani9-Sep-14 11:39 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 11:40
professionalKevin Marois9-Sep-14 11:40 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 11:46
professionalKevin Marois9-Sep-14 11:46 
GeneralRe: Chat Application Pin
Ravi Bhavnani9-Sep-14 11:57
professionalRavi Bhavnani9-Sep-14 11:57 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 11:58
professionalKevin Marois9-Sep-14 11:58 
GeneralRe: Chat Application Pin
Ravi Bhavnani9-Sep-14 12:00
professionalRavi Bhavnani9-Sep-14 12:00 
GeneralRe: Chat Application Pin
PIEBALDconsult9-Sep-14 13:58
mvePIEBALDconsult9-Sep-14 13:58 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 14:01
professionalKevin Marois9-Sep-14 14:01 
GeneralRe: Chat Application Pin
PIEBALDconsult9-Sep-14 14:16
mvePIEBALDconsult9-Sep-14 14:16 
AnswerRe: Chat Application Pin
PIEBALDconsult9-Sep-14 12:20
mvePIEBALDconsult9-Sep-14 12:20 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 12:27
professionalKevin Marois9-Sep-14 12:27 
GeneralRe: Chat Application Pin
PIEBALDconsult9-Sep-14 13:25
mvePIEBALDconsult9-Sep-14 13:25 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 15:07
professionalKevin Marois9-Sep-14 15:07 

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.