Geeks With Blogs
Moez Mousavi

Empty data in repeater doesn't have a template. Have a look at this:

            if (rptMyRepeater.Items.Count < 1)

            {

                if (e.Item.ItemType == ListItemType.Footer)

                {

                    Label lblFooter = (Label)e.Item.FindControl("lblEmpty");

                    lblFooter.Visible = true;

                }

            }

 

I found the above code is usefull if you need to show something like "There is no record" is your data source has no records. Although the ListView has a template.

 

Posted on Thursday, December 30, 2010 1:25 AM C# , ASP.NET , SQL | Back to top

Copyright © MoezMousavi | Powered by: GeeksWithBlogs.net