Resolving datasource expression

M

M.D.M.

Hi,

I have templated databound custom control similar to repeater.

<Display:Tree id="DB" runat="server">
<Root><%# DataBinder.Eval(Container.DataItem,"Node") %><br></Root>
<Leaves><%# DataBinder.Eval(Container.DataItem,"Subnode") %>, </Leaves>
</Display:Tree>

I need display only one Node and all its subnodes then line break etc. E.g.

Node1
Subnnode11, Subnode12, ... Subnode1N
Node2
Subnnode21, Subnode22, ... Subnode2N
....

I would like to do it so : in control code I will check whether DataItem
from DataSource is from <Root> element and if yes I will display it only
once. But I do not know how to check whether DataItem is from <Root> or from
<Leaves>.

Or will you suggest me other approach ?

I want to do it so becaause HTML formatting must be on .aspx not in code
(.cs).

Thank you
 
S

Steven Cheng[MSFT]

Hi Madar,

Thanks for your posting. Regarding on this issue, I've also seen your
another duplicated thread in this newsgroup. I've posted my reply there. If
you feel it convenient that we continue to discuss in that one, please feel
free to post there.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Resolving datasource expression
| thread-index: AcWMc8y2jzn5fAOyTSSEI//EvG3dqA==
| X-WBNR-Posting-Host: 194.212.229.226
| From: =?Utf-8?B?TS5ELk0u?= <[email protected]>
| Subject: Resolving datasource expression
| Date: Tue, 19 Jul 2005 08:09:03 -0700
| Lines: 28
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:9987
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hi,
|
| I have templated databound custom control similar to repeater.
|
| <Display:Tree id="DB" runat="server">
| <Root><%# DataBinder.Eval(Container.DataItem,"Node") %><br></Root>
| <Leaves><%# DataBinder.Eval(Container.DataItem,"Subnode") %>, </Leaves>
| </Display:Tree>
|
| I need display only one Node and all its subnodes then line break etc.
E.g.
|
| Node1
| Subnnode11, Subnode12, ... Subnode1N
| Node2
| Subnnode21, Subnode22, ... Subnode2N
| ...
|
| I would like to do it so : in control code I will check whether DataItem
| from DataSource is from <Root> element and if yes I will display it only
| once. But I do not know how to check whether DataItem is from <Root> or
from
| <Leaves>.
|
| Or will you suggest me other approach ?
|
| I want to do it so becaause HTML formatting must be on .aspx not in code
| (.cs).
|
| Thank you
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top