473,473 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

bounding for dropdown list in datagrid

Hello,

I put a dropdown list in ItemTemplate Column. I can select its value from
the dropdown list and store in a dataset, but when I retrieve records from
dataset, it doesn't show up in the datagrid. Is there anything I missed? and
where can I find something for reference?

Thanks.

Here is html code snippets.
<asp:datagrid id="dgProduct" style="Z-INDEX: 102; LEFT: 5px; POSITION:
absolute; TOP: 301px" runat="server" AutoGenerateColumns="False"
DataKeyField="ProductId" Width="100%">
<Columns>
<asp:BoundColumn DataField="Name" HeaderText="Product Name">
<ItemStyle Font-Size="X-Small"></ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="Product Code">
<ItemTemplate>
<asp:DropDownList id="ddlCode" runat="server">
<asp:ListItem></asp:ListItem>
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="B">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>


Nov 17 '05 #1
2 6904
Try this link and download gridtest.zip from my site for drop down sample
inside the grid...
Maybe it helps !
http://v4cnet.europe.webmatrixhosting.net/

Rgds
Sukesh
Brain Behind - www.v4cnet.com
"Michelle" <Mi******@yahoo.com> wrote in message
news:ub**************@tk2msftngp13.phx.gbl...
Hello,

I put a dropdown list in ItemTemplate Column. I can select its value from
the dropdown list and store in a dataset, but when I retrieve records from
dataset, it doesn't show up in the datagrid. Is there anything I missed? and where can I find something for reference?

Thanks.

Here is html code snippets.
<asp:datagrid id="dgProduct" style="Z-INDEX: 102; LEFT: 5px; POSITION:
absolute; TOP: 301px" runat="server" AutoGenerateColumns="False"
DataKeyField="ProductId" Width="100%">
<Columns>
<asp:BoundColumn DataField="Name" HeaderText="Product Name">
<ItemStyle Font-Size="X-Small"></ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="Product Code">
<ItemTemplate>
<asp:DropDownList id="ddlCode" runat="server">
<asp:ListItem></asp:ListItem>
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="B">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>



Nov 17 '05 #2
Try this link and download gridtest.zip from my site for drop down sample
inside the grid...
Maybe it helps !
http://v4cnet.europe.webmatrixhosting.net/

Rgds
Sukesh
Brain Behind - www.v4cnet.com
"Michelle" <Mi******@yahoo.com> wrote in message
news:ub**************@tk2msftngp13.phx.gbl...
Hello,

I put a dropdown list in ItemTemplate Column. I can select its value from
the dropdown list and store in a dataset, but when I retrieve records from
dataset, it doesn't show up in the datagrid. Is there anything I missed? and where can I find something for reference?

Thanks.

Here is html code snippets.
<asp:datagrid id="dgProduct" style="Z-INDEX: 102; LEFT: 5px; POSITION:
absolute; TOP: 301px" runat="server" AutoGenerateColumns="False"
DataKeyField="ProductId" Width="100%">
<Columns>
<asp:BoundColumn DataField="Name" HeaderText="Product Name">
<ItemStyle Font-Size="X-Small"></ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="Product Code">
<ItemTemplate>
<asp:DropDownList id="ddlCode" runat="server">
<asp:ListItem></asp:ListItem>
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="B">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>



Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Philip Townsend | last post by:
I have a datagrid that contains a dropdown list that is part of an EditItemTemplate. I need to run some code when the dropdown list builds in order to preselect an item in the list. Preselecting...
3
by: Big Dave | last post by:
I know it's been asked a million times before, but I still can't seem to find an answer that works. I've got a dropdown list in the footer template of a datagrid. The dropdown list databinds,...
1
by: Vijay Kerji | last post by:
Hi, I have a datagrid with dropdown list and Remove hyperlink in it as columns. When I remove a row from the datagrid, Dropdown list selection is retaining its previous value. i.e, removed...
6
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I...
2
by: Waran | last post by:
I Want to add a dropdown box in a datagrid on Page_Load. This Datagrid shares two tables. One table contains Employee details, and the other having the list of projects the employee is...
2
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
4
by: youvrajasnsm | last post by:
Hi All, >I am using datagrid control in asp.net with C#. >I have two dropdown list in datagrid e.g. one dropdown have Classname and another have Studentname. >now I want to show all the...
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
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...
1
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
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...
0
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...
0
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 ...
0
muto222
php
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.