Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem with nested Datalists

Reply
Thread Tools

Problem with nested Datalists

 
 
TheHach
Guest
Posts: n/a
 
      02-01-2006
Hi.

(For information, i'm working in VB.NET)

In our company, we have material that is divided into 3 parts :
- a system
- a batch
- an article

In each system are different batches, and in each batch different
articles.

So, in a webpage, I have to show our material like this :

(+) System 1
(+) Batch 1
Article 1
Article 2
(+) Batch 2
Article 3
Article 4
(+) Batch 3
(+) System 2
.....

So that when the user clicks on the (+) before the system or the batch,
it develops the list of batches or articles.
I tried to do this with nested datalists.
So, I have a main datalist where are listed the systems. In the
SelectedItemTemplate of this datalist, I've a second datalist which
lists the batches of the system. And in the SelectedItemTemplate of this
second datalist, I've the third which lists the articles of the selected
batch.
In our database, the three types of material are in the same table. They
are differentiated thanks to 3 columns : POSITION_C (position of the
system in the list), POSITION_D (position of the batch, or null if it's
only a system) and POSITION_E (position of the article, or null if it's
a system or a batch).
In my first datalist, I list the systems with a dataset which contains
all the material where position_d and position_e are null.
In the second datalist, the datasource is a function (GetDetailsD) where
there is an argument : the position_c of the current system.
The code is the following : DataSource='<%# GetDetailsD(DataBinder.Eval
(Container, "DataItem.POSITION_C")) %>'
In the third datalist, the datasource is another function (GetDetailsE
where the arguments are the position_c and the position_d of the current
batch. The code is : DataSource='<%# GetDetailsE(DataBinder.Eval
(Container, "DataItem.POSITION_C"),DataBinder.Eval(Contain er,
"DataItem.POSITION_D")) %>'

When I launch my page, the systems are correctly listed. When I click on
a (+) before a system, it shows me the correct batches that compose this
system. But when I click on a (+) before a batch to show the articles,
the line of the batch disappears. The problem comes from the datasource
of my second datalist : when I replace the argument of my function
GetDetailsD (i.e. DataBinder.Eval(Container, "DataItem.POSITION_C")) by
a number (2, or 4, or ...), it works fine. It's only when the argument
is DataBinder.Eval(Container, "DataItem.POSITION_C")....
What am I doing wrong ???

Thanks for help...
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RFdT?=
Guest
Posts: n/a
 
      02-01-2006
TheHatch,
For information I'm a VB.Net coder. You could have done that with a
treeview control and a custom IHierarchicalDataSourceControl, Heres the
bonus you can bind a menucontrol to the same datasource if you go that way.

Take a look at this one.
http://msdn2.microsoft.com/en-us/lib...cecontrol.aspx

If you decide to and find you need help with the
hierarchialdatasourcecontrol let me know by reply to thread or group.

Good Luck

DWS
Check out my ASP.Net 2.0 webparts and custom application providers
www.dws400.com




"TheHach" wrote:

> Hi.
>
> (For information, i'm working in VB.NET)
>
> In our company, we have material that is divided into 3 parts :
> - a system
> - a batch
> - an article
>
> In each system are different batches, and in each batch different
> articles.
>
> So, in a webpage, I have to show our material like this :
>
> (+) System 1
> (+) Batch 1
> Article 1
> Article 2
> (+) Batch 2
> Article 3
> Article 4
> (+) Batch 3
> (+) System 2
> .....
>
> So that when the user clicks on the (+) before the system or the batch,
> it develops the list of batches or articles.
> I tried to do this with nested datalists.
> So, I have a main datalist where are listed the systems. In the
> SelectedItemTemplate of this datalist, I've a second datalist which
> lists the batches of the system. And in the SelectedItemTemplate of this
> second datalist, I've the third which lists the articles of the selected
> batch.
> In our database, the three types of material are in the same table. They
> are differentiated thanks to 3 columns : POSITION_C (position of the
> system in the list), POSITION_D (position of the batch, or null if it's
> only a system) and POSITION_E (position of the article, or null if it's
> a system or a batch).
> In my first datalist, I list the systems with a dataset which contains
> all the material where position_d and position_e are null.
> In the second datalist, the datasource is a function (GetDetailsD) where
> there is an argument : the position_c of the current system.
> The code is the following : DataSource='<%# GetDetailsD(DataBinder.Eval
> (Container, "DataItem.POSITION_C")) %>'
> In the third datalist, the datasource is another function (GetDetailsE
> where the arguments are the position_c and the position_d of the current
> batch. The code is : DataSource='<%# GetDetailsE(DataBinder.Eval
> (Container, "DataItem.POSITION_C"),DataBinder.Eval(Contain er,
> "DataItem.POSITION_D")) %>'
>
> When I launch my page, the systems are correctly listed. When I click on
> a (+) before a system, it shows me the correct batches that compose this
> system. But when I click on a (+) before a batch to show the articles,
> the line of the batch disappears. The problem comes from the datasource
> of my second datalist : when I replace the argument of my function
> GetDetailsD (i.e. DataBinder.Eval(Container, "DataItem.POSITION_C")) by
> a number (2, or 4, or ...), it works fine. It's only when the argument
> is DataBinder.Eval(Container, "DataItem.POSITION_C")....
> What am I doing wrong ???
>
> Thanks for help...
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested datalists and width property of TD schapopa ASP .Net 0 01-05-2006 01:13 PM
Nested datalists and width property of TD schapopa ASP .Net 0 01-05-2006 01:07 PM
Nested Datalists Sparky Arbuckle ASP .Net 5 08-24-2005 09:56 PM
nested datalists event bubble Marty U. ASP .Net 0 12-01-2004 12:45 AM
findcontrol to find in nested datalists Greg Fischer ASP .Net 2 11-16-2004 03:47 AM



Advertisments