开发者

nested repeaters - how to sort

开发者 https://www.devze.com 2022-12-24 16:45 出处:网络
I have a table: Category with some sort of categories category1 category2 category3 I have another table Subcategory which has a fk to Category.

I have a table: Category with some sort of categories

 category1 
 category2
 category3

I have another table Subcategory which has a fk to Category. So, each category1 can have subcategoryB, subcategoryA, subcategoryZ.

Well... i've made two repeaters. The first one is binded to a linq data source which takes the categories from the parent table.

The children repeater is binded to that foreign key like:

DataSource='<%# Eval("Subcategories_1s") %>'

So the result is:

category1
   subcategoryB
   subcategoryA
   subcategoryZ
category2 

etc. Well, the strange question is: how can i order the subcategorie开发者_StackOverflows alphabetically? If i'd have binded the children repeater to a linq it would be easy. But in this case...?


Solved with this example !

Of course, no more linq data source, automatically binded, but used DataSet and relations. Check the above link for further informations.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号