Insert functionality in GridView – Part 2

by rahul 7/10/2009 8:45:07 PM

In my previous post I have shown that if you have no records in your table and try to bind that table to a grid view, you will get nothing. Not even the header rows. To get rid of this issue, there is a very simple way.

1. Select Edit Templates

image

2. Switch over to EmptyDataTemplate

image

3. Drag and drop a Form View control and bind it to the same data source.

4. Change the Default Mode of this Form View to Insert and you should be good to go.

image

And if this doesn’t suit your bill… “Code”. Winking

Hope this helps,
Rahul


Quote of the day:
Man has to suffer. When he has no real afflictions, he invents some. - Jose Marti


blog comments powered by Disqus

Comments

Rahul Soni

Rahul Soni  Twitter

 LinkedIn

 Facebook

 Email me



Vivek Kumbhar

Vivek Kumbhar  Twitter

 LinkedIn

 Facebook

 Email me


Stack Exchange

profile for Vivek at Server Fault, Q&A for system administrators and IT professionals

profile for Rahul Soni at Stack Overflow, Q&A for professional and enthusiast programmers

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

All Items
Sign in

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0