S
SimonZ
If I have gridView and one of the columns is template cpolumn, where I have
listBox in edit mode:
<asp:TemplateField>
<HeaderTemplate>CategorName:</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" text='<%#
Eval("CategoryName")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:ListBox Rows=1 runat="server" ID=lstCat
DataSourceID="SqlDataSource3" DataValueField="CategoryID"
DataTextField="CategoryName"></asp:ListBox>
</EditItemTemplate>
</asp:TemplateField>
In sqlDataSource I have defined update parameter:
<asp:ControlParameter ControlID="lstCat" Name="CategoryID"
PropertyName="SelectedValue" Type="Int32" />
When I click Update I can't read the value from my list box:
Could not find control 'lstCat' in ControlParameter 'CategoryID'.
How can I read the value from control which is inside grid view?
If I move this control outside the gridView it works.
It looks like that you can't read the controls which are inside other
controls.
Any idea?
Regards,Simon
listBox in edit mode:
<asp:TemplateField>
<HeaderTemplate>CategorName:</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" text='<%#
Eval("CategoryName")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:ListBox Rows=1 runat="server" ID=lstCat
DataSourceID="SqlDataSource3" DataValueField="CategoryID"
DataTextField="CategoryName"></asp:ListBox>
</EditItemTemplate>
</asp:TemplateField>
In sqlDataSource I have defined update parameter:
<asp:ControlParameter ControlID="lstCat" Name="CategoryID"
PropertyName="SelectedValue" Type="Int32" />
When I click Update I can't read the value from my list box:
Could not find control 'lstCat' in ControlParameter 'CategoryID'.
How can I read the value from control which is inside grid view?
If I move this control outside the gridView it works.
It looks like that you can't read the controls which are inside other
controls.
Any idea?
Regards,Simon