Try replacing <template name=3D"itemtemplate">
with <itemtemplate>
>>> dllist@c... 09/19/02 05:21PM >>>
I decided to convert from a datagrid to a datalist for other performance
reasons but I am still bugged that all the examples I find have the use
of Container.DataItem("Column_Name") why does it not work for me.
Here is a sample that I found:
<asp:DataList Runat=3D"server" id=3D"myDataGrid"
BorderColor=3D"black"
BorderWidth=3D"1"
GridLines=3D"Both"
CellPadding=3D"4"
CellSpacing=3D"0">
<template name=3D"itemtemplate">
<%# Container.DataItem("CompanyName") %>
</td><td>
<%# Container.DataItem("ContactName") %>
</td><td>
<%# Container.DataItem("ContactTitle") %>
</td><td>
<%# Container.DataItem("Phone") %>
</td><td>
<%# Container.DataItem("Fax") %>
</template>
</asp:DataList>
I appreciate your help, but do you have any other suggestions for me.
Thanks,
Dan Loverock
System Developer/Analyst.
Capecom Media Inc.
-----Original Message-----
From: Kevin_Hoffman@c... [mailto:Kevin_Hoffman@c...]
Sent: Thursday, September 19, 2002 11:57 AM
To: ASPX_Professional
Subject: [aspx_professional] Re: Retrieving an item from dataset into
datagrid template
This works:
DataRowView drv =3D (DataRowView) container.DataItem;
After that you can usr drv to access the databound items from the
DataSet:
drv["column_from_bound_table"];
This is, of course, assuming that the item is bound to a row. This type
of
code is typically found in a custom ItemTemplate class' DataBind()
method.
"Dan" <dllist@c...> on 09/19/2002 12:27:53 PM
Please respond to "ASPX_Professional" <aspx_professional@p...>
To: "ASPX_Professional" <aspx_professional@p...>
cc:
Subject: [aspx_professional] Retrieving an item from dataset into
datagrid
template
I am using :
DataBinder.Eval(Container.DataItem, Column_name_from_dataset")
to retrieve a value of a given column in a dataset(originally from Sql
Server stored procedure).
I am told that using DataBinder.Eval takes a performance hit, so I am
therefore trying to use
Container.DataItem("Column_name_from_dataset") or
Container.DataItem["Column_name_from_dataset"]
None of the above seem to work. I am wondering if there is a way to
retrieve this information from the dataset to my datagrid without taking
this hit.
Thanks,
Dan Loverock
System Developer/Analyst.
Capecom Media Inc.
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
to unsubscribe send a blank email to leave-aspx_professional-1132476S@p...
rox.com.