Insert functionality in GridView – Part 2

by rahul 7/10/2009 1:33: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

Search


Tags



Categories

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

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 2010, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0