开发者

ASP.NET, object data source 5+ rows returned - force repeater to only show one

开发者 https://www.devze.com 2022-12-11 01:31 出处:网络
Is there a 开发者_运维知识库way with ASP.NET to tell a data repeater which is working against a objectDataSource to only show the first row and not any others that are returned in the objectDataSource

Is there a 开发者_运维知识库way with ASP.NET to tell a data repeater which is working against a objectDataSource to only show the first row and not any others that are returned in the objectDataSource.

I can't limit the data source to one row as it's echo'ing to a grid above the repeater.

Forgive me if this is a stupid question!

Thanks in advance

C


in your repeater event handler you can use the event object to see what number the item in the collection you are on.

So you can say if that number > 0 or 1 or whatever it is, render, if not, do nothing.

It's been a really long time since I've used .NET, but I know you can lookup the index of the item in the ItemDataBound event.

0

精彩评论

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