473,554 Members | 3,181 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 4310
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
2194
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
1126
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
2133
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
3456
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
1354
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
2529
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
15028
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
7596
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7798
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7560
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
7887
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
5152
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
3556
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...
0
3545
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2015
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
1
1130
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.