By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,857 Members | 1,835 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,857 IT Pros & Developers. It's quick & easy.

Lisbox in a Gridview's templated field

P: n/a
To all,

I'm trying to bind a dataset to a listbox control that is in a gridview's
templated field. However, in the code behind the intellisense does not
recognize the ID name of my listbox control....thus not giving me an
opportunity to bind the listbox's datasource to a dataview. Can you make any
recommendations?

I'm trying to put a list box within a gridview so that an end user may
select a record from the listbox and relate the selected value to the
row/record within the gridview.

Here is my HTML code:

<asp:Panel ID="pnlADComputerView" runat="server" Height="216px"
Style="z-index: 100;
left: 392px; position: absolute; top: 40px" Width="280px">
<asp:UpdatePanel ID="uppADComputer" runat="server">
<ContentTemplate>
<asp:GridView ID="gvADComputer"
runat="server"
Height="176px"
Width="392px">
<Columns>
<asp:TemplateField HeaderText="Select Computer">
<ItemTemplate>
<asp:ListBox ID="ListBox1"
runat="server"></asp:ListBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="btnSelectComputer" runat="server"
OnClick="btnSelectComputer_Click"
Text="Select Computer(s)" Width="200px" /><br />
<asp:TextBox ID="tbTest1" runat="server"
Width="384px"></asp:TextBox><br />
</ContentTemplate>
</asp:UpdatePanel>

</asp:Panel>
Jul 18 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,
Below link provides solution to your query:
http://www.codeproject.com/dotnet/Ac...lsInsideGr.asp
http://gridviewguy.com/ArticleDetail...?articleID=169
Whenever i have query regarding GridView i refer site http://gridviewguy.com/
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Michael de Vera" wrote:
To all,

I'm trying to bind a dataset to a listbox control that is in a gridview's
templated field. However, in the code behind the intellisense does not
recognize the ID name of my listbox control....thus not giving me an
opportunity to bind the listbox's datasource to a dataview. Can you make any
recommendations?

I'm trying to put a list box within a gridview so that an end user may
select a record from the listbox and relate the selected value to the
row/record within the gridview.

Here is my HTML code:

<asp:Panel ID="pnlADComputerView" runat="server" Height="216px"
Style="z-index: 100;
left: 392px; position: absolute; top: 40px" Width="280px">
<asp:UpdatePanel ID="uppADComputer" runat="server">
<ContentTemplate>
<asp:GridView ID="gvADComputer"
runat="server"
Height="176px"
Width="392px">
<Columns>
<asp:TemplateField HeaderText="Select Computer">
<ItemTemplate>
<asp:ListBox ID="ListBox1"
runat="server"></asp:ListBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="btnSelectComputer" runat="server"
OnClick="btnSelectComputer_Click"
Text="Select Computer(s)" Width="200px" /><br />
<asp:TextBox ID="tbTest1" runat="server"
Width="384px"></asp:TextBox><br />
</ContentTemplate>
</asp:UpdatePanel>

</asp:Panel>
Jul 19 '07 #2

P: n/a
Hi,
Below links provides solution to your query:
http://www.codeproject.com/dotnet/Ac...lsInsideGr.asp
http://gridviewguy.com/ArticleDetail...?articleID=169
Whenever i have problem regarding gridview i refer site
http://gridviewguy.com/
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Michael de Vera" wrote:
To all,

I'm trying to bind a dataset to a listbox control that is in a gridview's
templated field. However, in the code behind the intellisense does not
recognize the ID name of my listbox control....thus not giving me an
opportunity to bind the listbox's datasource to a dataview. Can you make any
recommendations?

I'm trying to put a list box within a gridview so that an end user may
select a record from the listbox and relate the selected value to the
row/record within the gridview.

Here is my HTML code:

<asp:Panel ID="pnlADComputerView" runat="server" Height="216px"
Style="z-index: 100;
left: 392px; position: absolute; top: 40px" Width="280px">
<asp:UpdatePanel ID="uppADComputer" runat="server">
<ContentTemplate>
<asp:GridView ID="gvADComputer"
runat="server"
Height="176px"
Width="392px">
<Columns>
<asp:TemplateField HeaderText="Select Computer">
<ItemTemplate>
<asp:ListBox ID="ListBox1"
runat="server"></asp:ListBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="btnSelectComputer" runat="server"
OnClick="btnSelectComputer_Click"
Text="Select Computer(s)" Width="200px" /><br />
<asp:TextBox ID="tbTest1" runat="server"
Width="384px"></asp:TextBox><br />
</ContentTemplate>
</asp:UpdatePanel>

</asp:Panel>
Jul 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.