473,748 Members | 5,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DropDown in InsertItemTempl ate in ListView

Hi all,
When the below code executed it is not binding the Dropdownlist in
insertitemtempl ate. But the same is binding the Dropdownlist in
EditItemTemplat e. Also, when i use LINQDataSource in insertitemtempl ate is
also binding but only if i do like below it is not working...

<InsertItemTemp late>

<asp:DropDownLi st ID="DropDownLis t1" DataSource="<%# BindDept() %>"
DataTextField=" DepartmentName" DataValueField= "DeptID" runat="server">

</asp:DropDownLis t>

</InsertItemTempl ate>

CodeBehind:

public IEnumerable BindDept()
{

EmployeeInfoDat aContext dbEmp = new EmployeeInfoDat aContext();
var LINQQuery = from dept in dbEmp.Departmen ts

select dept;return LINQQuery as IEnumerable;
}

Am i missing something?

Sep 17 '08 #1
0 1278

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

Similar topics

3
2854
by: spawn666948 | last post by:
Hey, Everyone I can't seem to get the ListView to work on my Access 2000. I inserted the MS ListView Control. Let's call it "LV" for short. The, the Reference, MS Windows Common Controls 6.0 (SP6), is automatically added. The problem is when I go into code and type "me.LV.", the proper dropdowns don't appear. I'm expecting to see ".ListItems.", ".ColumnHeaders.", etc. But, instead I see, ".about.", ".application." For the life of...
4
1578
by: Steve Le Monnier | last post by:
I have a textbox with a lookup button facility. What I would like to do is also offer a quick selection facility by having a dropdown list appear under the control once the user has typed a single character. The same kind of functionality that you see on website textboxes these days. I don't want to use a combo, but I do like the fact that the dropdown list from a combo is highlighted by moving the mouse. Is it possible to make a standard...
1
3129
by: pjbates | last post by:
Hi, I've been using the GridView and DetailsView controls for a while, and I'm beginning to get annoyed by the redundancy of EditItemTemplate and InsertItemTemplate in many cases. In the following code, both edit and insert templates are identical. It would be great if I could define a generic template to be used for both edits and inserts. I know that there are many situations where the edit and insert templates will differ, but for...
0
1412
by: Swetha | last post by:
Hello I have a FormView with InsertItem, EditItem and ItemTemplates. Depending on from where the page is accessed, the page opens up in either Insert, Edit or ReadOnly mode. The FormView is databound. The problem I have is when the page opens up in Insert Mode. I require one of the fields to be populated with a databound field, but for some some reason this doesnt happen in the InsertMode. Following is the FormView:
2
8810
by: Dachshund Digital | last post by:
Ok, some one has to have done this... I have a listview with 3 columns. I want one column to hold a dropdown control so the user selects the listview item/column can select a option for that item/colum Help! LOL
3
1143
by: Savas Ates | last post by:
It is in my <EditItemTemplateTag.. <asp:DropDownList Runat=server ID="CIdeefixeSatis" SelectedIndex='<%# SelectMyIndex(DataBinder.Eval(Container, "DataItem.ideefixesatis")) %>' <asp:ListItem Value="True">Stokta Var</asp:ListItem>
0
1190
by: hooterbite | last post by:
The forms in Insert and Edit are almost identical, and each fom field has the same name in each template. For example, I have a txbName in the InsertItemTemplate and a txbName in the EditItemTemplate. My project has been fine until today, and now it says that " The ID 'txbName' is already used by another control." I did not change anything in my code. Anyone know why this would change, why I would start getting this error now when the page...
0
3242
by: Cas | last post by:
Hi, I want to create a InsertItemTemplate in a detailsview (only insertmode)programmatically. I first defined a Template, then i tried to create within that templatefield a InsertItemTemplate (but i don't know how), and finally a textbox. I did this: (Detailsview1 is defined in the .aspx file) Dim tfield As TemplateField
2
1763
by: ascll | last post by:
Greetings, How do I insert a dropdown box (predefined values=A,B,C,D) in DetailsView (prefer codeless)? Thanks ascll
0
8987
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9241
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4597
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3303
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
2
2777
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.