I am unable to find a way using the DetailsView control to add a new row when the table is empty. Is there an easy solution to this? Thanks.
I think it is more complex that that. I found the issue. It seems that a detailsview has a defaultmode of ReadOnly. When presented with an empty table in ReadOnly mode, it displays a blank. The trick is to change the mode of the detailsview to insert if the table is empty before the view displayed. Oneperson on the asp.net forum suggested that you do the following: protected void DetailsView1_OnDataBound(object sender, EventArgs e) { if (DetailsView1.PageCount <1) { DetailsView1.ChangeMode(DetailsViewMode.Insert); } } This command does the trick, but I still can't get it to fire before the page loads. If you use an OnDataBound method like the one above, do you have to reference it anywhere within the DetailsView control? Post Edited (VTA Admin) : 10/5/2008 1:31:00 AM GMT
Well I found it. You have to define the OnDataBound parameter to the method. It works fine. Thanks for the help. Sorry for the false alarm.
Hi, Take a look at this walkthrough: http://msdn.microsoft.com/en-us/library/sdba1d59.aspx Salute, Mark