DataGrid

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: rivera_carlos (carlos01_rivera_at_hotmail.com)
Date: 02/17/04


Date: Tue, 17 Feb 2004 07:16:09 -0800

Hello,
I using template columns as my columns in datagrid. Below, the real content of my web component . The problem is that it works quite fine for all the columns wich contents come from database, but for the last column, one that I have to modify its values I don´t get the <TABLE></TABLE> definition below as part of the contents sent to browser.
I changing the e.Item.Cells[indes].Text property within ItemDataBound event and that seems to be the problem since when I don´t add the handler everything goes OK. But I have to modify the last column and here resides the problem.

Question: Is there a simple way of doing this, without having to override HTMLTextWriter ?

<asp:TemplateColumn HeaderText="data"><ItemTemplate><asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Dt_Movimento", "{0:d}") %>'></asp:Label><TABLE class="p" id="Table1" cellSpacing="0" cellPadding="0" width="127" border="0" runat="server"><TR><TD id="TD2" background="Images/traco.gif"><IMG src="Imagens/pixel.gif" width="1" height="1" runat="server" ID="Img6"></TD></TR></TABLE></ItemTemplate></asp:TemplateColumn>



Relevant Pages

  • Re: Control panel visibility inside datagrid
    ... In ItemDataBound event add "onclick" attribute to ... It will be your client-side onclick event handler. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DialogResult.OK takes two clicks
    ... you need to check the code in your "save" handler. ... resides there ... HTH ... "John" wrote in message ...
    (microsoft.public.dotnet.languages.vb)
  • Re: DialogResult.OK takes two clicks
    ... I'll look at save handler ... >Hi, John, ... >resides there ... >> I am using code that creates a SaveFileDialog object ...
    (microsoft.public.dotnet.languages.vb)
  • AddHandler to Dropdownlist in ItemDataBound Doesnt work !!
    ... How do I add the dynamic event handler for a dropdownlist present in the ... I am doing it in the itemdatabound event of the datalist but it doesnt ... I am also setting the autopostback property to true for the dropdown ...
    (microsoft.public.dotnet.framework.aspnet)