473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Lisbox in a Gridview's templated field

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
2 4300
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hammad.awan_nospam | last post by:
Hello, I am using ASP.NET 2.0. What I have done is nested a gridview inside another column of a gridview using a template data field column declaritively in my web form. Inside this child...
0
by: Mike N | last post by:
Using the Gridview control in ASP.NET i developed a a web form which displays general user information using simple databinding ad databound columns direct to a dataset. I wanted to hide my ID...
2
by: Anonieko | last post by:
Hello ASPNET guru's, What is a clean way to go around the problem of displaying a GridView templated column where data can contain Single Quote ( ' )? I maybe too naive, but this is of course...
4
by: Chris Davoli | last post by:
I've got two questions on how to do things in the new GridView. I'm used to the DataGrid in ASP 1.1, so I need the equavalent in ASP 2.0 Gridview. 1.) What is the equavalent for Item Command...
6
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page...
0
by: Frank | last post by:
Hello All, I am working with VS.NET 2005 and I have an editable GridView whose HTML markup is shown below. In short, when the user clicks on the Edit button, one of the textboxes is replaced...
5
by: Andrew Robinson | last post by:
Does the DataObjectFieldAttribute have any affect on the GridView by way of an ODS? In partuculare, I was hoping that the max length of a text box within a gridview would be set to the length...
4
by: Mark Olbert | last post by:
I'm running into a well-described issue in the ASPNET model that I haven't found a good work around for. I have a GridView to which I dynamically add data-bound TemplateFields at run-time. The...
1
by: savajx1 | last post by:
I need to dynamically create a set of bound fields contained in a GridView control. I also have a single static CommandField that I can declare in the Columns <tagof the GridView control. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.