O
Oleg G.
Hi there!
I have datagrid with template column and I am using the same user control
for display (in ItemTemplate) and collect (in EditItemTemplate) information.
The user control is a number of text boxes basically in this case. But when
I put some values into this control (LinksData2) and go back to the server I
am not able to pick up the data from the control (LinksData2). It seems it's
not stored in ViewState at all. In the same time if I have the same control
on the page but outside of datagrid it works fine. How can I get the data
from the user control placed inside template column?
<asp:TemplateColumn>
<ItemTemplate>
<uc1:LinksData id="LinksData1" runat="server" IsReadOnly="True"
LinkData='<%# FillLinkData(DataBinder.Eval(Container.DataItem, "Url"),
DataBinder.Eval(Container.DataItem, "Description")) %>'></uc1:LinksData>
</ItemTemplate>
<EditItemTemplate>
<uc1:LinksData id="LinksData2" runat="server"
IsReadOnly="False"></uc1:LinksData>
</EditItemTemplate>
</asp:TemplateColumn>
Thanks.
I have datagrid with template column and I am using the same user control
for display (in ItemTemplate) and collect (in EditItemTemplate) information.
The user control is a number of text boxes basically in this case. But when
I put some values into this control (LinksData2) and go back to the server I
am not able to pick up the data from the control (LinksData2). It seems it's
not stored in ViewState at all. In the same time if I have the same control
on the page but outside of datagrid it works fine. How can I get the data
from the user control placed inside template column?
<asp:TemplateColumn>
<ItemTemplate>
<uc1:LinksData id="LinksData1" runat="server" IsReadOnly="True"
LinkData='<%# FillLinkData(DataBinder.Eval(Container.DataItem, "Url"),
DataBinder.Eval(Container.DataItem, "Description")) %>'></uc1:LinksData>
</ItemTemplate>
<EditItemTemplate>
<uc1:LinksData id="LinksData2" runat="server"
IsReadOnly="False"></uc1:LinksData>
</EditItemTemplate>
</asp:TemplateColumn>
Thanks.