473,586 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="pnlADComput erView" runat="server" Height="216px"
Style="z-index: 100;
left: 392px; position: absolute; top: 40px" Width="280px">
<asp:UpdatePane l ID="uppADComput er" runat="server">
<ContentTemplat e>
<asp:GridView ID="gvADCompute r"
runat="server"
Height="176px"
Width="392px">
<Columns>
<asp:TemplateFi eld HeaderText="Sel ect Computer">
<ItemTemplate >
<asp:ListBox ID="ListBox1"
runat="server"> </asp:ListBox>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>
<asp:Button ID="btnSelectCo mputer" runat="server"
OnClick="btnSel ectComputer_Cli ck"
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 4314
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="pnlADComput erView" runat="server" Height="216px"
Style="z-index: 100;
left: 392px; position: absolute; top: 40px" Width="280px">
<asp:UpdatePane l ID="uppADComput er" runat="server">
<ContentTemplat e>
<asp:GridView ID="gvADCompute r"
runat="server"
Height="176px"
Width="392px">
<Columns>
<asp:TemplateFi eld HeaderText="Sel ect Computer">
<ItemTemplate >
<asp:ListBox ID="ListBox1"
runat="server"> </asp:ListBox>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>
<asp:Button ID="btnSelectCo mputer" runat="server"
OnClick="btnSel ectComputer_Cli ck"
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="pnlADComput erView" runat="server" Height="216px"
Style="z-index: 100;
left: 392px; position: absolute; top: 40px" Width="280px">
<asp:UpdatePane l ID="uppADComput er" runat="server">
<ContentTemplat e>
<asp:GridView ID="gvADCompute r"
runat="server"
Height="176px"
Width="392px">
<Columns>
<asp:TemplateFi eld HeaderText="Sel ect Computer">
<ItemTemplate >
<asp:ListBox ID="ListBox1"
runat="server"> </asp:ListBox>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>
<asp:Button ID="btnSelectCo mputer" runat="server"
OnClick="btnSel ectComputer_Cli ck"
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
2197
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 gridview I have set an ItemStyle property of width 20% for the first templated field which contains a hyperlink control, and an ItemStyle of width 80%...
0
1127
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 columns but use them to activate commands from the gridview. But when I try retrieve the values the id values disappear if theID column is hidden. It...
2
2136
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 a common scenario. Scenario: * My database returns names that can contain single quote.
4
6714
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 event in GridView? I thought it would be RowCommand, but I can't get that event to fire with a check box field that I drag/drop in a template column in...
6
3460
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 and not show the templated fields, (hyperlinks) and also not print those fields?
0
1357
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 with a DropDownList that displays account numbers in a list. If the user selects an account from the DropDownList that already exists in the list, I...
5
2280
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 property of the attribute but it seems to have no affect. Any info would be helpful. Thanks, public class CustomerEntity {
4
2531
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 specific fields that are added depend on the state of the application. The contents of these fields displays properly after they are first...
1
15036
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 to add controls dynamically as I am trying to write a reusable , general , spreadsheet like display control that can take advantage of the built- in...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7954
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8215
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6610
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.