DropDown List DataSource for Options *AND* for DataSource Value in Database?

 

 I have a DropDown object list and so far I can set it to EITHER:

1) A SINGLE value (From table A using DataSource1)

2) Multiple value options (From table B using DataSource2) 

 
But how do I set both of the above? (i.e. set it to the value of option DataSource1 but allow the user to set it to any value in DataSource2) 


Thanks !



0
TacRedline
4/4/2007 2:03:28 PM
asp.net.object-datasource 16182 articles. 0 followers. Follow

3 Replies
684 Views

Similar Articles

[PageSpeed] 25

wht do u mean?? binding dropdown to one datasource containg ds1 and ds2??


Please remember to "Mark As Answer" if this post answered your question!

Bilal Shouman - MCAD.NET

|My Blog|
---------------------------------


0
JRICE
4/5/2007 8:42:32 AM
you can only bind to one datasource. If you want the selectedvalue to be the one in other DataSource then that value must be in your bind source also
0
rumbafum
4/5/2007 10:24:03 AM

Found my answer here:

 http://forums.asp.net/thread/1385216.aspx

and here 

http://forums.asp.net/thread/1641797.aspx

 

 


0
TacRedline
4/5/2007 1:17:27 PM
Reply:

Similar Artilces:

Drop down list in Form view returns error when value in bound field (data binding
I get the following error when I click edit to edit the details in the web form:'ddlUserRestrictionType' has a SelectedValue which is invalid because it does not exist in the list of items.Parameter name: value  I would like it to accept any value which currently exists in the database. Is this easily achievable? With what you've posted, all I can tell is that you are trying to set the SelectedValue of a ddl to a value that does not exist in the list.  It would be helpful if you can post some code and the expected values of this control.~ Timwww.bucketo...

Can a DataSource set the default value in a DropDownList (or the list fetch the value from a DataSource)?
Hi I have a DropDownList that gets its values from a DataSource-control. Nothing magic so far. What makes me scratch my head is that I need to set the default (selected) value in the drop down. As the values come from a data source, I do not know the key/value/index of the default I. Is there a possibility to make the drop down "ask the data source" which key should be the default (that is, only if the drop down is populated the first time, of course)? Background: I have an application where an administrator can set the "standard" month that the application s...

Dropdown list binds to previous datasource value
 I've created a custom drop down list by inheriting dropdownlist, and done a number of modifications to the DataSource property. The problem is that when I set the DataSource on the dropdown list it binds to the DataSource Previously set. Consider the following form:  My modified dropdownlist is on the left, Each of the buttons modifies the data source and causes the dropdownlist to databind. However only button 153 causes any values to appear in the list (this is intended). Here's a scenario:The page loads and the Drop Down List empty because no datasource has be...

DropDownList DataBinding to an object datasource but with itemlist from XML DataSource???
Hi,Im trying to get a solution to the following problem:I've got a number of DDL (DropDownList) controls on my page and I want each control to have an option range of -9 to 9.  However I also want the SelectedValue to be data bound to an object datasource control.I was initially populating the DDL item list with a recursive routine which added the itemlist to DDL controls on the page and then programmatically set the selected value of each control from an object instance.  To update the database I was applying the DDL selected values into the update method parameters of my obje...

Gridview Search Without Object Datasource Filter ParametersGridview Search Without Object Datasource Filter Parameters
Couple weeks ago I read a article about highlighted search in Gridview  (http://blog.evonet.com.au/post/2008/06/25/Gridview-with-highlighted-search-results.aspx) and in my project I used things I learned but now things changed I have a gridview and in code I give its datasource so because I dont use any objectdatasource I dont know where to write my filtering parameters. Is there anyway to use filtering without objectdatasource, or is there a way to give objectdatasource an source then bind it to my gridview. My code:  //No objectdatasource how can I conduct a search?GridView1.Da...

DataSource problem How to assign the datasource
Hi, I am kinda doing paging in dataGrid control and not sure how to assign the DataSource since the Source is declared in the asp.net web forums. Any ideas ? private void Styled_PageIndexChanged(object source,System.Web.UI.WebControls.DataGridPageChangedEventArgs e) { this.CurrentPageIndex = e.NewPageIndex; this.DataSource = .... this.DataBind(); } HighOnCodingWanna get high! What does "since the Source is declared in the asp.net web forums" mean?Thanks,Teemu KeiskiFinland, EU ohh I got the answer in the book. Thanks :DHighOnCodin...

Drop down list in FormView populated from different datasource
Hi, I have searched around for some answers to this. Any links would be greatly appreciated. To start, I'll explain the data model. I have a members table that has a typeId field. TypeId refers to a lookup table with the fields TypeId, TypeName...etc. I am using Linq to SQL to map the database. Now in my aspx page, I'd have a formview that binds to the members table. In the formview's edit mode, I'd like to have a drop down list that populates itself from the values in the type table (with TypeId as value and TypeName as Text) but sets the selected value based on t...

dropdown list datasource
Dear all,  I have the problem in using dropdownlist. There is two dropdown list and a sqldatastore and show in page load. one dropdownlist values can come from two situations. (1) from session variables (2) from another dropdownlist in the same page. How can I do? As I show all values from the table and set the selectedvalue from the page load of session variables if it has. If  not setting, when select from another dropdownlist, refresh the dropdownlist values which may contain more than one. In my case, I try to set the dropdownlist.datasource=dataset.tables(0) and the...

HOW TO STORE OBTAINED GRIDVIEW VALUES AS LIST AND USE IT FOR COMPARISON AGAINST OBJECT DATASOURCE
anyone reading this post....i have got the Datakeynames of every checked items in gridview ..how can i store it as list so that it can be passed in the sql statement at the below..For Each row As GridViewRow In GridView1.Rows Dim checkbox As CheckBox = CType(row.FindControl("reqchkbox"), CheckBox) If checkbox.Checked Thenreqslist = Convert.ToInt32(GridView1.DataKeys(row.RowIndex).V alue)End IfNext row  so that the above reqlist can bo stored as list/array/object to be used as select parameter in the below statementSELECT DISTINCT a.CourseId, a.CourseDescFROM Courses a, C...

1 Data Control, 2 datasources?
ok - I am fairly new to the .Net way of doing things - so maybe the answer to my question is staring me in the face, but I need some help to see it!  Thanks in advance for any who read this! :)  I have a form with a DataList on it.  in the Item template, I have many data controls. (CheckBoxList, DropDownList, etc.)  I have set the Datasource of the DataList to an ObjectDataSource (odsDetails) - and for fields that I can bind directly to controls (textboxes, etc) - this works great! However, I have other queries that populate the items in the dropdownlist and the...

Custom Datasource Controls Vs. Object Datasource Controls
Hi folks,I am a web developer developing pages in the project. I need to integrate the front end pages with the backend API. Active directory is being used as the database system for our project. I only use the API and the methods offered by it to interact with the data.For all the operations on the data, I have methods that I can call from the API (viz. Create(), Delete(), Modify() etc.). For connecting the data to my frontend data controls (viz. GridView, DropDownList etc.) I can use Object Datasource Control. I also read some articles about Custom Datasource controls. Now, I am having a d...

How to set DDL's selected value by datasource other than DDL's datasource
I have three TemplateFields in a Gridview. In each, the ItemTemplate has a label whose text value is bound to the GridView's DataSource. But in the EditItemTemplate the DropDownList is populated with a separate DataSource. This is a fairly common setup, so that wasn't too much to deal with. What I need to do is, when the GridView goes in to Edit mode and the DropDownList is populated and displayed I want the value that was in the bound label to be the default selected value in the DropDownList. As it currently is, the DropDownList renders with "Select..." as the defau...

gridview populated from datasource but want to add template column with different values from another datasource
 hi i have a gridview populated from datasource but want to add template column the is databound to a different datasource bringing different values and adding them to the same row but on new columns.. i have it bringing in the data but my problem is that it is not matching the daa to the correct primary key "ipc" its just outputting the list one after another.. my code is Dim col As System.Data.DataView col = AccessDataSource10.Select(New DataSourceSelectArguments()) For Each row As GridViewRow In GridView1.Rows Dim ipc As String = GridView1...

How do i pass an ID value from one datasource to another datasource located inside a repeater control?
Hello,  I am trying to develop a page that allows me to update stages for each item that does not have a status of complete.  I am going to break out what i am trying to do in 4 sections (hopefully to explain this as best as i can), why, what, goal, and problem. Why am i trying to do this? Every day we recieve media in the mail, and we have to put it online.  There are 5 stages we must pass to get this media online, Received, Importing, Compressing, Uploading, and Complete.  I am trying to create a page that will help our media loaders easily keep track of th...

Web resources about - DropDown List DataSource for Options *AND* for DataSource Value in Database? - asp.net.object-datasource

Datasource - Wikipedia, the free encyclopedia
A DataSource object has properties that can be modified when necessary. For example, if the data source is moved to a different server, the property ...

Inverness Graham Acquires DataSource
Inverness Graham , a lower middle market private equity firm headquartered in suburban Philadelphia, has acquired DataSource , a print supply ...

SmartGlance for iPad for iPad on the iTunes App Store
Read reviews, get customer ratings, see screenshots, and learn more about SmartGlance for iPad on the App Store. Download SmartGlance for iPad ...

Chaitanya Pandit (@chaitanyapandit) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Data source - Wikipedia, the free encyclopedia
... Data source A data source is any of the following types of sources for (mostly) digitized data: a database in the Java software platform, datasource ...

2ndQuadrant - PostgreSQL expertise from specialists with a source code level understanding of RDBMS ...
PostgreSQL expertise from specialists with a source code level understanding of RDBMS PostgreSQL Planets Gabriele’s PlanetPostgreSQL Gianni’s ...

Tagged entries for CLOUD COMPUTING
Alan Williamson's output as a Java Champion, Blog-City Architect, BlueDragon Creator, Author, Speaker and Internet Guru

Private equity deals
... of biometric identity management systems, applications and services. www.crossmatch.com Inverness Graham Investment has acquired DataSource ...

C# C Sharp and Tutorials on C# Friends.com
Learn the c# langauge to build web applications using our online tutorials with live demos. Participate in our forums and learn from others. ...

JavaScript UI Library, Ajax Components & HTML5 Framework - DHTMLX
DHTMLX offers a rich JavaScript library, UI components & HTML5 mobile framework. Build impressive web apps for both desktop and mobile devices. ...

Resources last updated: 11/27/2015 12:03:44 AM