473,763 Members | 8,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make treeview like datagrid

I want to display some drill-down data with a datagrid look. I can get the
exact functionality I want with a treeview, but I don't like the way the
treeview looks and formats the data. I want a multi-column table look like a
datagrid. It is not as easy as just hardcoding a datagrid within a datagrid
because the data may do down pretty deep. The treeview works great for this.
Is there a way to make the treeview look kind of like a datagrid or
something? Thanks.
Nov 28 '05 #1
5 2230
If the TV knows itemtemplates, than this is the magic word.
Add an item template and add a label control in that.
Set label text to"anything"
Then goto the 'html' source and modify this text propery for this label
with:

(From head:)
Text='<%#Eval(" Fieldname1" ) & Eval("Fieldname 2" ) %>'

Something like that.
This is just a start of course, you can swap the label for a table etc..

"lanem" <la***@discussi ons.microsoft.c om> schreef in bericht
news:8B******** *************** ***********@mic rosoft.com...
I want to display some drill-down data with a datagrid look. I can get the
exact functionality I want with a treeview, but I don't like the way the
treeview looks and formats the data. I want a multi-column table look
like a
datagrid. It is not as easy as just hardcoding a datagrid within a
datagrid
because the data may do down pretty deep. The treeview works great for
this.
Is there a way to make the treeview look kind of like a datagrid or
something? Thanks.

Nov 28 '05 #2
Note, you should change Fieldname1 etc.. for the real fieldname.
I'm curious myself, will do a test tomorrow.
"Edwin Knoppert" <in**@pbsoft.sp eedlinq.nl> schreef in bericht
news:dm******** **@azure.qinip. net...
If the TV knows itemtemplates, than this is the magic word.
Add an item template and add a label control in that.
Set label text to"anything"
Then goto the 'html' source and modify this text propery for this label
with:

(From head:)
Text='<%#Eval(" Fieldname1" ) & Eval("Fieldname 2" ) %>'

Something like that.
This is just a start of course, you can swap the label for a table etc..

"lanem" <la***@discussi ons.microsoft.c om> schreef in bericht
news:8B******** *************** ***********@mic rosoft.com...
I want to display some drill-down data with a datagrid look. I can get
the
exact functionality I want with a treeview, but I don't like the way the
treeview looks and formats the data. I want a multi-column table look
like a
datagrid. It is not as easy as just hardcoding a datagrid within a
datagrid
because the data may do down pretty deep. The treeview works great for
this.
Is there a way to make the treeview look kind of like a datagrid or
something? Thanks.


Nov 28 '05 #3
The Treeview does not have itemtemplates.

"Edwin Knoppert" wrote:
If the TV knows itemtemplates, than this is the magic word.
Add an item template and add a label control in that.
Set label text to"anything"
Then goto the 'html' source and modify this text propery for this label
with:

(From head:)
Text='<%#Eval(" Fieldname1" ) & Eval("Fieldname 2" ) %>'

Something like that.
This is just a start of course, you can swap the label for a table etc..

"lanem" <la***@discussi ons.microsoft.c om> schreef in bericht
news:8B******** *************** ***********@mic rosoft.com...
I want to display some drill-down data with a datagrid look. I can get the
exact functionality I want with a treeview, but I don't like the way the
treeview looks and formats the data. I want a multi-column table look
like a
datagrid. It is not as easy as just hardcoding a datagrid within a
datagrid
because the data may do down pretty deep. The treeview works great for
this.
Is there a way to make the treeview look kind of like a datagrid or
something? Thanks.


Nov 28 '05 #4
Yes, i just noticed.
So i tried a different but more harder approach:

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s)
End Sub

Protected Sub TreeView1_TreeN odePopulate(ByV al sender As Object, ByVal e
As System.Web.UI.W ebControls.Tree NodeEventArgs)
e.Node.Text = Now & "<BR>" & Now.TimeOfDay.T oString
End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TreeView ID="TreeView1" runat="server"
OnTreeNodePopul ate="TreeView1_ TreeNodePopulat e">
<Nodes>
<asp:TreeNode Text="New Node" Value="New Node">
<asp:TreeNode Value="New Node" PopulateOnDeman d="true"
</asp:TreeNode> </asp:TreeNode>
</Nodes>
</asp:TreeView>
&nbsp;</div>
</form>
</body>
</html>

Maybe you can dump a table look-alike in during each node's event?
Let me know, i'm curious about this.

Edwin,
"lanem" <la***@discussi ons.microsoft.c om> schreef in bericht
news:56******** *************** ***********@mic rosoft.com... The Treeview does not have itemtemplates.

"Edwin Knoppert" wrote:
If the TV knows itemtemplates, than this is the magic word.
Add an item template and add a label control in that.
Set label text to"anything"
Then goto the 'html' source and modify this text propery for this label
with:

(From head:)
Text='<%#Eval(" Fieldname1" ) & Eval("Fieldname 2" ) %>'

Something like that.
This is just a start of course, you can swap the label for a table etc..

"lanem" <la***@discussi ons.microsoft.c om> schreef in bericht
news:8B******** *************** ***********@mic rosoft.com...
>I want to display some drill-down data with a datagrid look. I can get
>the
> exact functionality I want with a treeview, but I don't like the way
> the
> treeview looks and formats the data. I want a multi-column table look
> like a
> datagrid. It is not as easy as just hardcoding a datagrid within a
> datagrid
> because the data may do down pretty deep. The treeview works great for
> this.
> Is there a way to make the treeview look kind of like a datagrid or
> something? Thanks.


Nov 28 '05 #5
This exactly fits your description:

http://www.componentart.com/demos/tr.../WebForm1.aspx

If your time is worth anything, then paying for this full-featured treeview
might be "worth" it's cost.

-HTH

"lanem" <la***@discussi ons.microsoft.c om> wrote in message
news:8B******** *************** ***********@mic rosoft.com...
I want to display some drill-down data with a datagrid look. I can get the
exact functionality I want with a treeview, but I don't like the way the
treeview looks and formats the data. I want a multi-column table look
like a
datagrid. It is not as easy as just hardcoding a datagrid within a
datagrid
because the data may do down pretty deep. The treeview works great for
this.
Is there a way to make the treeview look kind of like a datagrid or
something? Thanks.

Nov 28 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3564
by: Banda RamaNarsi Reddy | last post by:
Hi, We have a Datagrid and we are using third party tool treeview control. it's like we have to add treeview control in the datagrid dynamically, such that each cell will have a tree structure then we have to populate the data from the database according to the id. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
0
2504
by: Marco Martin | last post by:
Hi all, I need to figure the best solution to my problem. <Background> A Bill of materials application that has a treeview as the master and a datagrid as the details. The treeview holds both master and detail information but only displays a brief description. When a node is clicked, if the node has children, it displays all Child information in detail form in a datagrid. If it has no children, it simply displays itself as a row in
1
5468
by: Grey | last post by:
I want to design a datagrid form with treeview inside the row. The datagrid would first display the subtotal of the sales in each row. When user click the "+" from each row, the breakdown sales figure would be come out. Is it possible to do that in windows application with C#?? Million thanks
2
1872
by: Sandy | last post by:
Is there some way to incorporate paging with a treeview, or are there some new controls out there that would be capable of this sort of thing? Can a treeview be put in a datagrid? If so, how? -- Sandy
7
2838
by: vsiat | last post by:
I am trying to create a treeview out of a database table with the typical structure ID, NAME, PARENTID, TYPE, EXTRA_INFO, where is linked to the . What I want to achieve is create a tree made of custom, extended nodes, which include all the extra information contained in the table and not just typical TreeNode objects. To do that, I first created a structure with all the extra
2
7499
by: Tymbow | last post by:
I'm building a web application that is analogous to the Windows XP file explorer in function. The left column contains a TreeView, and the right column a DataGrid populated by selecting TreeView nodes. The TreeView populates dynamically as there are a significant number of nodes. The DataGrid displays both the items and the nodes from the TreeView. Using the explorer analogy this means the TreeView shows folders, and the DataGrid folders...
3
2256
by: Shawn | last post by:
Hi. I'm working with the TreeView control in my ASP.NET 1.1 application. I have a problem I haven't been able to figure out. When I click on a node (not expand), whether it's a parent node, a child node or a leaf node then a DataGrid is populated based on the node's ID property. If I expand a node then the DataGrid is not populated. This works fine. The problem is that this doesn't work if I collapse the tree. If I collapse the tree...
1
1958
by: saravanaVijayakumar | last post by:
I'm new to xml .. I had created a application such a way that I have to display the xml file in treeview control in C#.Net Application ... If I select the particular Node it should display the attributes of that node in DataGrid But I am displaying the attributes in dataGrid if i use the following Code XmlNode x = root.SelectSingleNode("//JDF")
0
2190
by: saravanaVijayakumar | last post by:
I'm new to xml .. I had created a application such a way that I have to display the xml file in treeview control in C#.Net Application ... If I select the particular Node it should display the attributes of that node in DataGrid But I am displaying the attributes in dataGrid if i use the following Code XmlNode x = root.SelectSingleNode("//JDF")
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.