467,910 Members | 1,565 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

ListBox inside grid view

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
Mar 13 '06 #1
  • viewed: 1278
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Nicolas Favre-Félix | last post: by
1 post views Thread by ericm1155 | last post: by
3 posts views Thread by Raja | last post: by
1 post views Thread by JMann101 | last post: by
9 posts views Thread by zdrakec | last post: by
reply views Thread by Jon | last post: by
8 posts views Thread by PeteOlcott | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.