473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

GridView EmptyDataTemplate Disabling

Hello,
I want to use the GridView footer for inserting new items into my table. However when the table is empty I'm forced to see the EmptyDataTemplate. Is there a way to disable using the EmptyDataTemplate? If not, what are some strategies for overcoming this?
I'm binding to a strongly typed object data source.
Thanks,
-Biff
May 19 '09 #1
3 8385
maliksleo
115 100+
@BiffMaGriff
then remove it from the source or make use of it while no data is available put some of your web links over there or place some sort of ad or place a picture to show that no record found or what ever you want. Its the extra feature of gridview.

maliksleo
May 20 '09 #2
Hi BiffMaGriff,
The problem you are facing is due to the default behaviour of the asp.net gridview control. By default, if no data is present, it hides header and footer. And you are left to use the EmptyDataTemppate to message that no data is present [somewhat a relief]. But very often you need to display the header and footer. See, Display asp.net gridview header and footer when no data is present. Hope this solves your problem. Thanks.
May 20 '09 #3
Hi, Thanks for the responses.
I solved it using your way sangham with an empty object added onto my object data source collection and then hiding it.

-Biff
May 22 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Shimon Sim | last post by:
I have HuperLink control on EmptyDataTemplate I need to adjust NavigateUrl depending on what is going on in the application. How do I get the reference to this control? Thank you, Shimon.
2
by: Dabbler | last post by:
I'm using a gridview bound to an SqlDataSource. If the table is empty the gridview doesn't appear on the page. Is there a way I can force the empty gridview to appear to allow inserting new rows? ...
1
by: Stu Lock | last post by:
Hi, I've spent the last hour trawling google for this - but all I find are people asking the same question! I have a gridview which is being databound to an empty datasource. I can display...
0
by: j-in-uk | last post by:
Hi, I am using the gridView control at first the EmptyInsert command is executed from the EmptyDataTemplate but when a user clicks Edit after the 1st insert, for some reason it detects the...
1
by: Jeff | last post by:
Hey asp.net 2.0 I have this GridView in my web page. My problem is that it get populated with all the fields of the MembershipUser class. I thought only UserName would be displayed, but it...
13
by: AG | last post by:
I have a gridview that I bind to a List(of Type) at runtime. Not using a datasource control. The gridview has a template column with an imagebutton whose commandname is set to 'Delete'. The...
3
by: jobs | last post by:
Say I have Gridview with some Buttonfields I want to enable or disable based on the values of other bound data? Here I want I only want to enable button Rate only if field lastAction = "Export...
13
by: Tomasz Jastrzebski | last post by:
Helo All, The problem: GridView control does not render at all (header/footer) when the data source is empty. I have seen a similar question posted already, but I just can not believe there is...
2
by: Kbalz | last post by:
I have a user control that has a gridview in it. I am dynamically setting up its datasource and columns based on an XML file. I have everything done except adding columns to the gridview, so that...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.