how to add categories in treeview when get all?

Feb 12 at 1:11 PM

hi

how to add categories in treeview(parent and child)
i can Add Parent with this code .

 WordPressWrapper ww = new WordPressWrapper(textBox2.Text, textBox3.Text, textBox4.Text);
                var cat = ww.GetCategories();
                for (int i = 0; i < cat.Count; i++)
                {
                    if (cat[i].parentId == "0")
                    {
                        TreeNode tn = new TreeNode(cat[i].categoryName);
                        tn.ForeColor = Color.Blue;
                        tvCat.Nodes.Add(tn);

this is working good . (i have not any problem for add parent) . for add child i writhe this code .
for (int i = 0; i < cat.Count; i++)
               
{
                   
if (cat[i].parentId != "0")
                   
{
                       
for (int j = 0; j < cat.Count; j++)
                       
{
                           
if (cat[i].parentId == cat[j].categoryId)
                           
{
                                tvCat
.Nodes[i].Nodes.Add(cat[j].categoryName);
                           
}
                       
}
                   
}
             
}

but i catch error (Specified argument was out of the range of valid values.parameter name: index) .how i can solve it ?



Feb 13 at 6:44 AM

does anybody can help me ?

Coordinator
Feb 13 at 5:27 PM
Sorry...
This doesn't appear to be an issue with the wrapper..?



On 13 February 2012 07:45, man7tomani <notifications@codeplex.com> wrote:

From: man7tomani

does anybody can help me ?

Read the full discussion online.

To add a post to this discussion, reply to this email (joeblogs@discussions.codeplex.com)

To start a new discussion for this project, email joeblogs@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 22 at 6:04 AM

dear alexjamesbrown

can help me to fix this ?

when get all categories , how i can add in treeview ? with parent and child ?

Coordinator
Feb 22 at 9:13 AM
I'm not sure I understand

The wrapper returns everything you need
A search on how to use the treeview control will probably help you more

Alex

On 22 Feb 2012, at 07:04, "man7tomani" <notifications@codeplex.com> wrote:

From: man7tomani

dear alexjamesbrown

can help me to fix this ?

when get all categories , how i can add in treeview ? with parent and child ?

Feb 25 at 11:02 AM
Edited Feb 25 at 11:03 AM

i try search about this but i cant fix this

how i can solve it ?

Coordinator
Feb 25 at 11:45 AM
What exception are you getting?
Mar 1 at 6:19 PM
Edited Mar 1 at 6:21 PM

this is  :

Specified argument was out of the range of valid values.parameter name: index

 

i want just add categories with child and parent in treeview. how can i do it ?

Coordinator
Mar 1 at 6:22 PM
this is not an exception with JoeBlogs
Please consult books online for how to use the control you're trying to use.