473,320 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to bind data to a textbox in a template column in WebForm DataGrid

Hi,

I am trying to put a textbox in a template column both for displaying and
editing. When I add the following line to the HTML code
<%#DataBinder.Eval(Container.DataItem, "comments")%>
between the following lines generated by Visual Studio.NET
<ItemTemplate>
<asp:TextBox id="TextBox2" runat="server">

</asp:TextBox>
</ItemTemplate>
I got an error when switch to the design mode:
"There was an error rendering the control. Check to make sure all
properties are valid".

However, I can do the same exact thing with a Label control, which doesn't
generate an error.

Can anyone point out what I did wrong?

Many thanks,

Jodi
Jul 19 '05 #1
0 2823

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

Similar topics

6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
3
by: Dmitry Korolyov [MVP] | last post by:
Is that possible? In other words, I want a dropdown list (and other list-type controls) which appears in edit more of a templated column to be populated with data at the run time. An attempt to do so...
2
by: Vijaya | last post by:
Can we bind data to textbox in a headertemplate in a template column of a datagrid? If so please give some code snippets. Thank you
0
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format....
3
by: mg | last post by:
I have a DataGrid (WebForm - C#) that has a template column that contains a dropdownlist named "DdlTest" In DataGrid1_UpdateCommand, the lin DropDownList ddlTest = (DropDownList)...
3
by: MrMike | last post by:
Hi. I have a dataset on my webform which I successfully fill by calling a Sub that occurs after the Page_Load. My question is - I have a textbox control which I need to populate with the contents...
0
by: Jodi | last post by:
Hi, I am trying to put a textbox in a template column both for displaying and editing. When I add the following line to the HTML code <%#DataBinder.Eval(Container.DataItem, "comments")%>...
0
by: Tony Hedge | last post by:
Hello, I have done this before but now cannot get it to work... ASP.Net 1.1, a datagrid on a page. There are two template columns. Each of the those columns has a HeaderTemplate section. The...
1
by: Sharon | last post by:
Hello All, Is it possible to update Sql Table through DataGrid. I have a DataGrid which is being populated through a stored procedure, all i wanted to do is to update one field...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.