Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

'System.Data.DataRowView' does not contain a property with the name 'Title'.  when using itemTemplate in DetailsView control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rote - 28 Feb 2008 05:29 GMT
I don't know what i'm doing wrong but i can't get the
<asp:Label ID="Label3" Text='<%# Eval("Title") %>' Runat="Server"/>
in my itemplate to work.
The Select statement is right and it returns data and it also works in EDit
Mode.
But when i use the label with the Title i get the error.

If i type in another property lets say title_id it does work

Any ideas?

<asp:TemplateField HeaderText="Title">

<ItemTemplate>

<asp:Label ID="Label3" Text='<%# Eval("Title") %>' Runat="Server"/>

</ItemTemplate>

<EditItemTemplate>

<asp:DropDownList id="ddlTitle" runat="server"

DataSourceID="sqlDS2"

BackColor="Pink"

DataTextField="Title" DataValueField="Title_ID"

SelectedValue='<%# Bind("Title_ID") %>'>

</asp:DropDownList>

</EditItemTemplate>

</asp:TemplateField>

<asp:SqlDataSource ID="sqlDS2"

Runat="Server"

SelectCommand = "SELECT [Title] FROM [Employee_T] ORDER BY Title"

DataSourceMode="DataSet"

ConnectionString="<%$ ConnectionStrings:MwcConnectionString %>">

</asp:SqlDataSource>
Eliyahu Goldin - 28 Feb 2008 09:43 GMT
DataSourceID="sqlDS2" is set for the dropdown list. It has nothing to do
with the datasource for the detailsview. Apparently, the datasource you are
using for the detailsview doesn't contain a Title column.

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

>I don't know what i'm doing wrong but i can't get the
> <asp:Label ID="Label3" Text='<%# Eval("Title") %>' Runat="Server"/>
[quoted text clipped - 44 lines]
>
> </asp:SqlDataSource>
rote - 29 Feb 2008 00:22 GMT
Yeah thanks Eliyahu figured that out already

> DataSourceID="sqlDS2" is set for the dropdown list. It has nothing to do
> with the datasource for the detailsview. Apparently, the datasource you
[quoted text clipped - 48 lines]
>>
>> </asp:SqlDataSource>
rote - 29 Feb 2008 00:24 GMT
Eliyahu,
     My other questions is regarding DetailsView is
can i use html tables in DetailsView control
I want to format the view to have more than 2 columns and i would be having
update,Edit features too..
Any ideas on this?

> DataSourceID="sqlDS2" is set for the dropdown list. It has nothing to do
> with the datasource for the detailsview. Apparently, the datasource you
[quoted text clipped - 48 lines]
>>
>> </asp:SqlDataSource>
Eliyahu Goldin - 29 Feb 2008 10:09 GMT
The DetailsView presents one field in a row. It is not good for what you
want. User the FormView instead.

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin

> Eliyahu,
>      My other questions is regarding DetailsView is
[quoted text clipped - 55 lines]
>>>
>>> </asp:SqlDataSource>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.