It's true that I wrote it myself (well, I copied it from a sample I found).
Here is the snippet of the aspx file:
<asp:TemplateColumn HeaderText="Statistik<br>gruppe">
<ItemTemplate>
<asp:Label id=Label1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.m_akeyp1") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList id=ddlM_akeyp1 runat="server" CssClass="Entryfield"
SelectedIndex='<%# GetM_akeyp1((string)DataBinder.Eval(Container.Data Item,
"m_akeyp1")) %>' DataSource="<%#GetM_akeyp1List()%>" datatextfield="text"
datavaluefield="value">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateColumn>
"Lars Netzel" wrote:
Are you having an EditItemTemple in you TempleColumn or just ItemTemplate?
Maybe this is to basic but I have to ask cause oif you wrote the
templatecolumn yourself It's easy to forget.. whereas if you startoff with a
bound column and then convert it to a templatecolumn it creates both type
automatically.
/Lars NetzeL
"Carlo Marchesoni" <Ca*************@discussions.microsoft.com> skrev i
meddelandet news:FC**********************************@microsof t.com...I have an editable Datagrid and some columns (4 and 5) are TemplateColumns
(because I have DropDownLists there).
Everything works fine except that if I want to retrieve the values (that I
can see visually) from the DataGrid with the following loop the Values of
the
TemplateColumns are returned as blank - what am I doing wrong ?:
foreach (DataGridItem dgi in dgrDu01.Items)
{
string myvalue1 = dgi.Cells[1].Text; //ok
etc..
string myvalue = dgi.Cells[4].Text; // returns blank, although I have a
value
}
Thanks for your help