Forms Data Controls :: How To Use Multiple Datasources In One Gridview
Feb 26, 2010
I have one grid in which i use one datasource to get several data . Now i want to ad a column in my grid and bind that column with a column from another datasource.
I've been filtering my gridviews with the FilterExpression of the underlying ObjectDataSource etc. I am wondering how I can implement filtering on my GridViews if I just directly databind it to a datatable etc?
i saw this post on[URL] so the problem is .... if there is a datasource in some editeitem template in grid view .... it won't be accessible from out of the edit-item field.....
here's my code...
[Code]....
that i have here is ID-column which contains a linqdatasource taking a where parameter from a dropdownlist and they are both in the same edit-template field.
and i have in another column (CourseTypeID-column ... edit-item template) a dropdownlist ..... now this dropdownlist i want to bind it to the linqdatasource exists in the ID-column (edit-item template)..... is that possible in the designer (or from) not code behind ..... and how ????
problem: bad design but this is what they want.I have a datasource which binds to a dropdownlist. This is fine. this displays companies (with companyID as the DataValueField)they then, underneath, want a seperator and then after that, a list of "groups".of course, DDL cannot have multiple Datasources. So how can I bind from 2 sources into 1 DDL? I cannot seem to think of a way. Even adding the items at the end of the databinding will not help as the GroupID maybe the same as a CompanyID for the DataValue.
Is it possible to bind two separated datasources to one dropdown list such that they are both alphabetically sorted and seprated by some sort of line. I know there is a way to insert elemets manually, but I'm not sure of the 2 separate datasources. I've serached this forum and while there were several posts none of them offered any workable solution.
i have a mysql database and a sql server database.there is a link between these two tables via a foreign key.is it possible to connect two datasources together in my datamodel? if so please can someone tell me how i can do this? i have them both present in the data model, i just want to be able to link the two databases together.i am using asp.net mvc, c# and entity framework - all in visual studio 2008
I have gridview with 3 columns and one textbox in each column. My requirement is when i paste 3 cells of copied data from excel to textbox in first column of gridview automatically 2nd cell data has to be pasted in textbox of 2nd column and 3rd cell data to textbox of 3rd column of gridview. How can it be done and can anyone provide the best code.
I have an inventory page with a gridview that shows 1 item per record, each item starts with a checkbox in the gridview. Currently users can select multiple records and hit the order button and everything has worked well. Now I have multiple pages in my gridview, and if a user selects a few records from the first page, and then goes to the second page, all the records (checked checkboxes) disappear from the first page.
I create reports sometimes with a gridview and export the data to excel. Lets say I have like multiple gridviews and I wanted to export each gridview to excel under its own spreadsheet.
So gridview1, gridview2, gridview3 are exported to excel under $heet1, $heet2, $heet3.
I know how to export multiple gridviews to 1 excel sheet but I don't know how to export them separately under their own spreadsheet.
I've been researching online, and i'm continously searching, but does anyone know how to do what i'm trying to do with the gridview and excel or is this not possible?
I got a web page, it has a tabcontainer, within each tab, there will be a gridview, all the tabs and gridview are created at run-time, i have only one code, that I will loop through to create all those tabs and gridview. When I apply the sorting, and I click on the column name on any grid, it returned an error saying index was out of bound. BUT, when there is only ONE grid view created, it is working fine, I suspect it mixed up all the grid view's id and so on. But I have assigned different ID to gridview
I want search with multiple names in Name coloumn. example I have pass the criteria to Name cloumn is 'Atul', 'Mayur', 'Suraj' this three names how to pass in a query.
i have a page having 12 gridviews which cell background color depend on another cell value.now the requirement of my project is download to these 12 gridviews in single excel file in multiple sheets like gridview 1 in sheet1 gridview2 in sheet2 likewise,,,,,,,,,,,i have seen your article on downloading multiple gridviews on same page but i want in above mention format........
I have a question in gridview, I want to combine my two or more records into a single cell with two rowsfor Example i have a ID, Name, Year Start, and Year End for Column name in database and i want call it into my gridview that the Year Start and Year End will combine to Year like:
I am trying to select multiple rows in gridview.But i am stuck at one point now, and not able to proceed.
I my GridView1_RowCreated event i am doing a post back to Gridview selectedindexchanging Event.
[Code]....
In my GridView selected index changing event i am stroing the row index in a List<string> and if user click the same rew twice iam removing the item from list by:
[Code]....
[Code]....
But the problem is the css property does not work correctly, once you click on a row , its sets its property correctly, but if you click second time then it wont clear the css property.
In my page I would like to load multiple gridview one by one (with or without update panel). Once the page loads I want gridview one to start loading then the next one load and so for the other gridviews.
While the gridview is loading the gridview should show loading gif.
I have a GridView that refreshes based on user input. The GridView is setup to display data in pages if the number of rows is more than 20.Here is a scenario that I need resolved:When the user selects an item the GridView displays 2 pages of data. The user selects page 2 to view its contents. Next the user selects another item that also has 2 pages. By default the GridView remains of page 2 when it is refreshed with new data. How do I ensure that the GridView defaults to Page 1 when the user clicks on another item? The GridView is databound to the control that the user selects.
I need to display some data in a gridview. Its shipping data.
Part of the data can come from a generic database query. Static shipping data that can be looked up from the database. Part of the data is external and has to be queryed from USPS. Any suggestions on what is the best way to accomplish this.
Should I just programmatically fill the gridview from the code behind doing the database lookup manual and filling the gridview with manual data then going out and filling the rest of the gridview with the data obtained from the USPS service?