How can I define a repeater template that spreads into 'n' columns per 'z' items in each column?
I have a List<string>
with country names as items in it.
List<string> myCountries;
I want to bind this list as a datasource to an asp.net Repeater.
What I want to achieve is to define a template within my repeater so that it binds the country names into columns side by side and limit each column to have maximum 5 countries.
Basically it has to start binding on the very left column and when there is 5 countries bound it should add a new column on the right and go on binding in this new column. After 5 more countries 开发者_StackOverflow中文版it should again add one more column and go on like this.
How can I achieve this?
Countries:
- country 1 + country 4 + country 7 +
- country 2 + country 5 + country ..+
- country 3 + country 6 + country n +
I am not sure whether repeater is having property repeatcolumn repeatrow and repeatDirection property.
but datalist can do your job..
精彩评论