473,321 Members | 1,667 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,321 software developers and data experts.

DropDownList in DetailsView

Hi,

I have a detailsview with

AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True"
AutoGenerateInsertButton="True"

and dropdownlist in all the rows in

<EditItemTemplate><here></EditItemTemplate>

DefoultView of detailsview is ReadOnly, i want that when user clicks edit dropdowns should be visible and then user can click update value in order to update those values.


i donno how to do it. msdn says when we will click edit by defoult text boxes will be displayed.

can someone give me someexample or idea about how to do it.
Feb 3 '09 #1
3 1308
Hi , Vineetbandal,
You are right in the position. Go straight ahead. If you have edititemtemplate and you place dropdownlists there they will sure show in the edit mode. Only thing you need is populate your dropdownlist. This can be done in the design time or programmatically later. Cheers.
Feb 4 '09 #2
Hi,


But something is wrong there.. when i click on edit... it just desplayes me
EmptyDataText="There are no records."...

i dont understant why???
Feb 4 '09 #3
this is my detailsview ..
Expand|Select|Wrap|Line Numbers
  1. <asp:DetailsView  Runat="Server" ID="DetailsView1" FieldHeaderStyle-Font-Bold="true"
  2.         FieldHeaderStyle-HorizontalAlign="Right" 
  3.                         AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" 
  4.                         AutoGenerateInsertButton="True" AutoGenerateRows="False" BorderStyle="None" 
  5.                         BorderWidth="1px" CaptionAlign="Left" CellPadding="3" CssClass="Normal" DefaultMode="ReadOnly"
  6.                          EmptyDataText="There are no records." Visible="False"> 
  7.  
  8. <FieldHeaderStyle HorizontalAlign="Right" Font-Bold="True" ></FieldHeaderStyle>
  9.         <Fields>
  10.  
  11.  
  12.     <asp:TemplateField HeaderText="UserLevel">
  13.  
  14.                         <ItemTemplate>
  15.                         <asp:Label ID="lblUser" runat="server" Text='<%# Bind("UserLevel") %>'></asp:Label>
  16.            </ItemTemplate>
  17.            <EditItemTemplate><asp:DropDownList ID="DDL1" runat="server" DataSourceID="UserLevelDataSource" 
  18.             DataTextField="UserLevelDesc" DataValueField="UserLevelID"></asp:DropDownList>
  19.         <asp:ObjectDataSource ID="UserLevelDataSource" runat="server" 
  20.             SelectMethod="AdminUserLevelList" TypeName="bpDevDataClassesDataContext">
  21.         </asp:ObjectDataSource>
  22.  
  23.            </EditItemTemplate>
  24.            </asp:TemplateField> 
  25.  
  26.     <asp:TemplateField HeaderText="Status">
  27.     <ItemTemplate>
  28.     <asp:Label ID="lblStatus" runat="server"></asp:Label>
  29.     </ItemTemplate>
  30.     <EditItemTemplate></EditItemTemplate>
  31.     </asp:TemplateField> 
  32.  
  33.     <asp:TemplateField HeaderText="ActionLevel">
  34.     <ItemTemplate>
  35.     <asp:Label ID="lblAction" runat="server" Text='<%# Bind("ActionLevel") %>'></asp:Label>
  36.     </ItemTemplate>
  37.     <EditItemTemplate></EditItemTemplate>
  38.     </asp:TemplateField> 
  39.  
  40.     <asp:TemplateField HeaderText="TypeLevel">
  41.  
  42.     <ItemTemplate>
  43.     <asp:Label ID="lblType" runat="server" Text='<%# Bind("TypeLevel") %>'></asp:Label>
  44.     </ItemTemplate>
  45.     <EditItemTemplate></EditItemTemplate>
  46.     </asp:TemplateField>    
  47.  
  48.         </Fields>
  49.     </asp:DetailsView>
Feb 4 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michael Gross | last post by:
Hello I have a GridView, and a DetailsView to edit the data. In the DetailsView I have two TemplateFields with a DropDownList in each TemplateField. Now I want that when the user selects an item...
0
by: 47computers | last post by:
Hello. I'm having a bit of difficulty with some DropDownList controls within templates in a DetailsView on my web form. Basically, I have a form where a user is building a "location profile" with...
1
by: JJ | last post by:
Hi. I am having trouble getting a dropdownlist to work properly in a detailsview: The code is something like: <asp:DetailsView ID="dvwSubscriber" runat="server" AutoGenerateRows="False" ...
0
by: Dan | last post by:
Hi, I have a detailsview with two fields: in editmode, one is a textbox and the other is a dropdownlist. i want to update both fields using the detailsview. My problem: when clicking on the...
3
by: EdisonCPP | last post by:
Hi, I have a DetailsView with a template field with a dropdownlist added to it. If the data coming into that field were put into a textbox, it would look like: Small|Medium|Large|X-Large. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.