Unbelievable DataGrid Web Control. (where is productivity?)

G

Guest

Hello.
I am trying to do the simplest of things. These are exactly the steps I follow:
1. create an sqlConnection to an SQL Server database.
2. create a DataSource and produce a DataSet to a single table.
3. drop a DataGrid control to a Web Form and bind it to the DataSet.
4. customize the DataGrid:
4.1 unckeck "create columns automatically..."
4.2 add 3-4 bound columns, 2 Select columns, 1 Edit Button, 1 Delete Button and 1 template column.
4.3 the template column is bound to a Boolean value and I thought it is more appropriate to have a CheckBox displayed instead of a Label control.
5. in the Page_Load event I type the simplest of code:
DataSource.Fill(DataSet,"TableName");
DataGrid.BadaBind();
6. Amazingly the DataGrid won't run by no means. Instead I get the not-so-explanatory error message:

"Server Error in '/Protocol2004' Application. Control 'dgProtocols__ctl2__ctl0' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server."

You understand of course that something is terribly wrong internally. Please note that I just used the designers and property editors!!!!

Any explanations / solutions ?

Is this the so called "productivity" of the .NET platform?

Dimitris
 
A

avnrao

put your html code in a form tag. by default when page is created, the form
tag will be created. i dont know how its missing, but place your html
content in a form tag. (under body tag).

Av.
 
G

Guest

Dimitrus,
Sarcasm will usually get you knowhere.

However having said that, I believe this to be a known issue, and looking for "dataloss fix for visual studio" on msdn will eventualy lead you to a fix on the download site.

http://www.microsoft.com/downloads/...FamilyID=B9EE2B55-7FA8-4104-A3DB-2147753C82A1

This issue can happen with any control, and is caused by VS nausing things up when you switch between design & HTML view .I had the same issue with a button control

Hope iy helps. I think you'll find the datagrid to be the best invention since sliced bread...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top