How to get number of items in a queryuniview?

Tom F asked on January 16, 2017 05:40

Hi I was wondering how to programatically get the number of items in a queryuniview at a headertemplate level? I wanted to manipulate the header/footer based on the total repeater item count after data bind.. and doing it at an item level is pretty messy

Recent Answers


Ilesh Mistry answered on January 16, 2017 10:40

Hi Tom

Not sure the full context, but could you use 'GetItemsCount' Method, which is inherited from UniView? Or have you considered this already?

Thanks Ilesh

0 votesVote for this answer Mark as a Correct answer

Tom F answered on January 16, 2017 23:54

Hi Ilesh I tried:

protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); var moo = RegularQueryUniViewer.GetItemsCount(); var literalmoo = RegularQueryUniViewer.Controls[0].Controls[0].FindControl("mooliteral"); literalmoo.Text = moo.ToString(); }

'UniView.GetItemsCount(IEnumerable)' is inaccessible due to its protection level

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.