473,507 Members | 12,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unbelievable DataGrid Web Control. (where is productivity?)

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
Nov 18 '05 #1
2 1544
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.

"Dimitris Pantazopoulos" <Dimitris Pa***********@discussions.microsoft.com>
wrote in message news:D8**********************************@microsof t.com...
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

Nov 18 '05 #2
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/d...B-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...

"Dimitris Pantazopoulos" wrote:
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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2567
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
3
4856
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
1
5281
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so...
9
5039
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
0
1683
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
3
7179
by: chreo | last post by:
Hello. I have datagrid. I found code to select all row in data grid (by mouse or arrow keys). This works great - user can select row and... ....and I want to go to next control. For...
4
3916
by: Frank | last post by:
Hello All, I ham using VS.NET 2003. Have followed instructions from http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several other articles to no avail. I am pulling my hair...
6
5720
by: p.mc | last post by:
Hi all, I'm having major problems with a userControl which contains a datagrid. My problem concerns data binding. The Page_Load() procedure calls the DataBind procedure to bind the datagrid...
0
2895
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5619
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,...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.