Ernesto
-
10/23/2009 1:07:03 PM
Need help developing webpart - gridview and itemtemplates...
Hello, i am still a newbie when developing under ASP.NET.
I am coding a webpart The class definition is this: public partial class CMSWebParts_OurWebParts_OurEmployeeList : CMSAbstractWebPart
In the .aspx page i use a GridView and i want to do something like this :
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Number" DataSourceID="SqlDataSourcevueContactsTriesWebRecherche"> <Columns> <asp:TemplateField HeaderText="Number" InsertVisible="False"> <ItemTemplate> <% =ReturnName(DataBinder.Eval(Container.DataItem, "Number").ToString())%> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>
However, i can't seem to use Container.DataItem.
I get a message from intellisense telling me : 'CMS.PortalEngine.WebPartContainerInfo' does not contain a definition for 'DataItem
I have tried so many different things. A bit of help will be most welcome.
|