CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 5/28/2007 6:32:02 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 14 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
pafo
Asp.Net User
2 treeview problems5/28/2007 6:32:02 AM

0/0

Hello,
I have 2 problems with the treeview control.
My database where i save the treeview nodes looks like this:
ID - PARENTID - TITLE
1  -      NULL    -  Test1
2  -      NULL    -  Test2
3  -      NULL    -  Test3
4  -        2        -   Test4
5  -        4        -   Test5
6  -        1        -   Test6
7  -        4        -   Test7
8  -        5        -   Test8

This is just an example to illustrate the problem.

1)
I am exporting this list above to a file and then i am trying to import it to a new database, any ideas? since all the ids and parentids will be diffrent in the new database, any links or something of how to import it?

2)
This list i am also writing to a Word document, along with some text from another table. Now my question is, how can i number the Rows in a correct order to be printed on a word document?
I want something like this:

1) Test1
1.1) Test6
2) Test 2
2.1) Test 4
2.1.1) Test 5
2.1.1.1) Test 8
2.1.2) Test7
3) Test 3

How can i loop thru the DataRow[] and get the information like this and add it to a ArrayList (or something that you can loop and print it to a word document, it should be added in this order)?
I need the id and "1)" + name to be saved, perhaps a small class that you then copy to the arraylist. But how to loop thru it and get the numbers?

Patrick

Amanda Wang - M
Asp.Net User
Re: 2 treeview problems5/31/2007 8:51:33 AM

0/0

Hi,

1) I think you may set the ID column as an Indentity column. Please ensure you don't set it as an Indentity column. Thank you. 2) I suggest you use recursion . You can just reference the following code as an example.

     

// Assuming that dsMenu is the DataSet contains your data. Involk this method with 0 as its parameter at the first time.
private void Print(int parentLevel)
    {
        try
        {
            DataRow[] drCurrentLayer;
            if (parentLevel == 0)//if it?s the top level
                drCurrentLayer = dsMenu.Tables[0].Select("PARENTID = " + DBNull);
            else
                drCurrentLayer = dsMenu.Tables[0].Select("PARENTID =" + parentLevel.Value);

            if (drCurrentLayer == null || drCurrentLayer.Length <= 0)
                return;
            
            foreach (int i=0; i< drCurrentLayer.Length; i++)
            {
                //
                //TODO: Add your relevant logic here
                //
                Print (Convert.ToInt32(drCurrentLayer[?ID?]));// use the ID of the current record
            }
        }
        catch
        {
            throw;
        }
    }
 

 


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Visual C# 2005 Recipes: A Problem-Solution Approach Authors: Allen Jones, Matthew MacDonald, Rakesh Rajan, Pages: 565, Published: 2006
Visual Basic 2005 Recipes: A Problem-Solution Approach Authors: Todd Herman, Allen Jones, Matthew MacDonald, Rakesh Rajan, Pages: 664, Published: 2007
Adaptive Technologies for Learning & Work Environments Authors: Joseph J. Lazzaro, Pages: 204, Published: 2001
Practical RDF: Solving Problems with the Resource Description Framework Authors: Shelley Powers, Pages: 331, Published: 2003
Creating Client Extranets with Sharepoint 2003 Authors: Mark E. Gerow, Pages: 216, Published: 2006
Foundations of GTK+ Development Authors: Andrew Krause, Pages: 630, Published: 2007
RCM Guidebook: Building a Reliable Plant Maintenance Program Authors: Jim August, Pages: 267, Published: 2004
XML Problem, Design, Solution: Problem - Design - Solution Authors: Mitch Amiano, Kay Ethier, Conrad D'Cruz, Michael D. Thomas, Pages: 333, Published: 2006
Advances in Concurrent Engineering: Presented at Seventh ISPE International Conference on Concurrent Engineering: Research and Applications, Lyon Cluade Bernard University, France, July 17-20, 2000 Authors: P. Ghodous, Biren Prasad, D. Vandorpe, Pages: 890, Published: 2000

Web:
xkcd • View topic - GTK treeview problems GTK treeview problems. Moderators: EvanED, Hammer ... Post subject: GTK treeview problems. Post Posted: Tue Oct 14, 2008 2:00 am ...
2 treeview problems - ASP.NET Forums 2 treeview problems. Last post 05-31-2007 4:51 AM by Amanda Wang - MSFT. 1 replies. ... I have 2 problems with the treeview control. ...
TreeView problem (should be simple...) - .NET VB TreeView problem (should be simple...). Get answers to your questions in our . ... Insert(1, nodeChild) ' adds child of 2001/2 to parent of ...
Visual Basic: A Treeview problem I hope you can help with, agility ... Date: 2/14/2008 Subject: A Treeview problem I hope you can help with Question This problem seems so simple in theory, but for the life of me I just can't ...
vbCity/DevCity.NET Forums :: .NET :: .NET Newbies :: Treeview Problem Edited by - dreamer on 9/2/2008 3:07:00 PM ... #2 Re: Treeview Problem ... posts : 8094 since: Sep 2, 2002 from: Leicester, England ...
pyGtk treeview problem - Ubuntu Forums 5 Cups of Ubuntu. Join Date: Oct 2006. Posts: 28. Thanks: 1. Thanked 4 Times in 2 Posts. pyGtk treeview problem ...
MSDN Visual Studio Team System - Web and Load Testing Testing asp ... Testing asp.net 2 treeview ajax, event validation problem. Drolevar, Sachin, and Abunet, it sounds like you are having trouble getting the control to work. ...
Vista Style 2 Treeview Menu - Deluxe Tree Templates Vista Style 2 Treeview Menu. Deluxe Tree is cross-frame and cross-browser DHTML Javascript tree menu with a lot of powerful features, flexible parameters ...
C# .NET C# TreeView Problem C# TreeView Problem - Arvind Singh 11-May-06 02:00 2:00:34 AM · recursive method - Virgil Hretcanu 11-May-06 02:31 2:31:12 AM ...
TreeView Problem : documentation, treeview Keywords: TreeView Problem ... 2, Asynchronous TreeView population · MS Visual Basic ... MainFrame OS; Microsoft; Miscellaneous; OS / 2; Security ...

Videos:
SquirrelNet.us - Flamethrower + Christmas Tree (View 2) www.SquirrelNet.us Flamethrower + Christmas Tree (View 2)
RCxhet - Como crear un menu,treeview ASP .net Part 2 RCxhet - Como crear un menu,treeview y un site map en asp.net Ancho de un contentPlaceHolder Agregar imagen de master page en pagina que esta en subc...
hitting the tree view 2 video uploaded from my mobile phone
Treeview Indians TOC Champs Final Inning Bottom of the 6th inning. Down by 2 runs, 13-11. Kevin just got out of a bases loaded no-outs jam in the top of the inning. Let the drama unfold...
Sunset drive 112707-2 Pieter asks Alex to do a visual tour of one of his favorite view. A long time dead tree broken by the wind today. A few drops of water ...
How To Upload Videos YouTube Won't Wreck (OUTDATED) Here is the new guide: http://youtube.com/watch?v=hLtTNE61iik The method described in this video no longer works so your only hope is to go HQ by cl...
Atlanta Apartment Fire At 12:18am on August 15, 2006 a fire started in an apartment complex on Tree View Ct, Lithonia, GA. The ENTIRE building was destroyed and 14 families...
GCCS97 #145 Proceedings of the GCC Developers Summit 2007 From http://ols.108.redhat.com/2007/GCC-Reprints/GCC2007-Proceedings.pdf . compatibility, which allowed us to concentrate on the deve...
Structuring Personal Information When Everything Can Be Saved and Searched... Google TechTalks May 17, 2006 William Jones William Jones is an Research Associate Professor in The Information School at the University of Washingt...
GCCS97 #147 Proceedings of the GCC Developers Summit 2007 From http://ols.108.redhat.com/2007/GCC-Reprints/GCC2007-Proceedings.pdf . line numbers are displayed for the user. Although the user c...




Search This Site:










skin install help??

blank page for text

database deployment problems

user defined forms?

how do i redirect the user base on role

webpartconnections with dynamically created parts

servicedcomponent calling a servicedcomponent

dbnull returned from stored procedure

property won't persist between postbacks

querystring ("value") to textbox error-any ideas???

multiple smtp accounts

dts &amp; objectqualifier question

app_localresources problems

localizecontroltitle

logging from one application to another

new classifieds starter kit setup

asp.net newbie

problem with aspnet_merge.exe building

uploading pa problem

open loginpage in a different frame when using loginstatus control

configurationsettings.appsettings.add() - why?

explicit initialization is not permitted with multiple variables declared with a single type specifier

uploading files and postback

sub-application hosting on dnn site

install of vwd express hangs

questionnaires

how to give access to only some users to see some columns in a datagrid?

why is this so hard to install?

simple 3.x questions

cannot create web tests.

 
All Times Are GMT