Forms Data Controls :: Finding Best Way To Handle This Scenario - Select Gridview Row And Show Related Info Below?
Dec 12, 2010
almost typical master-detail scenario except the 'detail' data I want to display below the gridview will be coming from both the table that is bound to the gridview (master) and a related table.
simplified example: tableMain with field1, field2, field3 bound to master gridview. I need to select a row from the master gridview and have a form display below with field4 and field5 from tableMain, as well as all fields of tableDetail where field1 of tableMain equals field1 of tableDetail.
Is this what a 'formview' control is for? or do I just arrange my own controls to accommodate the data? Would a formview work considering my source will be partially from both the main table and the detail table? This is one of the scenarios were I know I could come up with something using none of the databound controls (except the master gridview), but I want to use the controls provided when it makes sense to do so, and utilize their benefits etc...
View 6 Replies
Similar Messages:
Feb 23, 2011
I am using an ADO Entity Model for my ms-sql database.
My database has a Resellers table which has ResellerID (primary key, int) and Name columns along with other data.
I also have an Orders table which contains OrderID (primary key, int), OrderDate, ResellerID (foreign key to Resellers.ReselerID).
If I just do a query like:
[Code]....
I am able to reference order.Reseller.Name just fine with no problems.
However I have an EntityDataSource on my page as follows:
[Code]....
Notice the Include="Reseller" attribute in the datasource... I also have a GridView tied to that datasource as follows: I cut some of it off for breavity:
[Code]....
Now what I have listed above will run with no errors, but what I want to do is replace the column that displays "ResellerID" with the equivilant to order.Reseller.Name. In other words I want my grid to display the reseller's name rather than the numeric ID.
I have tried to change the DataField to "Reseller.Name" but that will generate the following error:
A field or property with the name 'Reseller.Name' was not found on the selected data source.
Is there anyway to do this without me writing a custom select statement in my code behind?
View 2 Replies
Dec 19, 2010
I have to implement this common scenario but I'm getting in trouble (I'm new in asp)
I have to open a modalDialog, then I want an animation to indicate a "loading message" and when the data are ready
I want show them ina grid view. How can show the data when they are ready and interrupt the loading message?
View 2 Replies
Apr 24, 2010
I want the select statement for the above scenario.
View 2 Replies
May 13, 2010
I'm creating a site that will offer several different services (blogs, videos, images..), all under the same site.
Each service will use a separate database and all services must use the same membeship info. Users will only need one login to access all these services.
For the membership database i will use the default aspnetdb database.
There are two ways i can think of:
1) Use a join-query between two databases, each time i want to show some service records per user.
2) Create a custom membership-info table in each service's database, and keep it in sync with the master membership table in aspnetdb database.
The custom membership table will be like this:
Id - int, primary, identity
UserId - uniqueidentifier (of aspnetdb database)
What is the best way to do this in the long run, when i will have six or seven or more services ?
View 2 Replies
Nov 24, 2010
I have a problem in getting my gridview to update. The datasource gets its data from 2 related tables using the following select statement:
SELECT StudentSubject.StudentID, Students.[1stName], Students.Surname, Students.Grade, StudentSubject.Subject, StudentSubject.GradeOverall, StudentSubject.ReportYear, StudentSubject.ReportSession, StudentSubject.Criteria1Grade, StudentSubject.Criteria2Grade,
StudentSubject.Criteria3Grade, StudentSubject.Criteria4Grade, StudentSubject.Criteria5Grade, StudentSubject.Criteria6Grade, StudentSubject.Criteria7Grade, StudentSubject.Criteria8Grade, StudentSubject.Criteria9Grade, StudentSubject.Criteria10Grade, StudentSubject.Comment
FROM (Students INNER JOIN StudentSubject ON Students.StudentID = StudentSubject.StudentID)
WHERE (StudentSubject.Subject = ?) AND (StudentSubject.ReportYear = ?) AND (Students.Grade = ?) AND (StudentSubject.ReportSession = ?)
The ? stem from combo box controls which I use to filter the results So far so good!
However, when I try to update the data in just one of the tables, nothing happens, no error, just no update. The update statement I'm using is:
UPDATE StudentSubject SET GradeOverall = ?, Criteria1Grade = ?, Criteria8Grade = ?, Criteria7Grade = ?, Criteria6Grade = ?, Criteria5Grade = ?, Criteria4Grade = ?, Criteria3Grade = ?, Criteria2Grade = ?, Criteria9Grade = ?, Criteria10Grade = ?, Comment =?
WHERE (StudentID = ?) AND (Subject = ?) AND (ReportYear = ?) AND (ReportSession = ?)
I've tried this with a similar setup with just on table and it works fine.
<asp:AccessDataSource ID="DSGrid" runat="server"
DataFile="D:RW docsVisual Studio 2008WebSitesFellbach ReportsApp_DataReports - Copy.mdb"
SelectCommand="SELECT StudentSubject.StudentID, Students.[1stName], Students.Surname, Students.Grade, StudentSubject.Subject, StudentSubject.GradeOverall, StudentSubject.ReportYear, StudentSubject.ReportSession, StudentSubject.Criteria1Grade, StudentSubject.Criteria2Grade,
StudentSubject.Criteria3Grade, StudentSubject.Criteria4Grade, StudentSubject.Criteria5Grade, StudentSubject.Criteria6Grade, StudentSubject.Criteria7Grade, StudentSubject.Criteria8Grade, StudentSubject.Criteria9Grade, StudentSubject.Criteria10Grade, StudentSubject.Comment
FROM (Students INNER JOIN StudentSubject ON Students.StudentID = StudentSubject.StudentID) WHERE (StudentSubject.Subject = ?) AND (StudentSubject.ReportYear = ?) AND (Students.Grade = ?) AND (StudentSubject.ReportSession = ?)"
UpdateCommand="UPDATE StudentSubject SET GradeOverall = ?, Criteria1Grade = ?, Criteria8Grade = ?, Criteria7Grade = ?, Criteria6Grade = ?, Criteria5Grade = ?, Criteria4Grade = ?, Criteria3Grade = ?, Criteria2Grade = ?, Criteria9Grade = ?,
Criteria10Grade = ?, Comment = ? WHERE (StudentID = ?) AND (Subject = ?) AND (ReportYear = ?) AND (ReportSession = ?)">
<SelectParameters>
<asp:ControlParameter ControlID="ComboSubject" DefaultValue="German" Name="Subject" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="ComboYear" DefaultValue="2010 - 2011" Name="ReportYear" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="ComboGrade" DefaultValue="1a" Name="Grade" PropertyName="SelectedValue" Type="String"/>
<asp:ControlParameter ControlID="ComboSession" DefaultValue="November" Name="ReportSession" PropertyName="SelectedValue" Type="String"/>
</SelectParameters>
</asp:AccessDataSource>
<asp:AccessDataSource ID="DSGrid" runat="server"
View 10 Replies
Mar 24, 2010
i have this xml file which i read using the DataSet.ReadXml( path ) method . The tables created from the Xml file is Related in such a maner that each product has many options. Product is in one table and Options are in another.Now all i want to do is display the related tables in One Gridview. For your reference below is the products Xml file,
[Code]....
Now this is what i have done in the Code behind , have a look below
[Code]....
Now the Grid works Great if i want to Display Individual tables out from Dataset but not when they are related . Please do shine your Knowledge on what should be done to display Child ~ Master relationship. By the way , its a definite NO for someone who would show me that link from msdn about displaying XML data using Xmldatasource and gridview [That's a lousy way to display data]
View 2 Replies
Jun 9, 2010
I would like to display students and their grades with a GridView and LinqToSQL like this:
[Code]....
I found this topic but it doesn't answer my question: http://forums.asp.net/t/1557987.aspx
I have a many-to-many relationship between students and assignments called "grades".The grade for the assignment is stored in that table in a "gradeNumber" column.The many-to-many relationship seems to be a problem.I tried adding a TemplateField to my grid:
[Code]....
It doesn't work:
...student does not contain a property with the name grade.
It does work when I use class.name however to get a student's class he is in.In code students .grade[0].something works however My LINQ entities are extended with custom code to allow me to retrieve studentx.Assignments or assignmentx.Students.(I would also like to specify which assignments should be displayed in the grid.)
View 1 Replies
Jan 10, 2010
I have a gridview on which there is a colume of image button for user to select a particular row. When a row is selected, a modal pop up appears for user to edit data and finally uers hit update button (within modal pop up). I expect to update the selected gridview row with info on modal pop up. My question is how do I get the row number within the Update_Click event.
View 2 Replies
Mar 30, 2010
I've been hunting for a solution to grab the radiobuttonlist when they answer that particular question. It varies for the number of questions, but only one displays at a time, but there could be a radiobuttolist or checkboxlist based on the question type. I was figuring I could do this easy in the row command of the gridview, but that hasn't worked out so well since I can't get the datarow for some reason.
View 1 Replies
Aug 18, 2010
I've got a gridview that is databound with LINQ in the code behind. One column shows the id from the table. I would like to show a more human friendly product name that is associated with that id number but is from another table. Thought I had it figured out by entering a Template field in the gridview tags (in the .aspx page) and an item template within that with
<ItemTemplate>
<%Eval(Products.productName")%></ItemTemplate>
but when I try to build it says this can only be done in the context of a databound control.
Can I add this column within the gridview tags or does it have to be done from the code behind?
View 3 Replies
Oct 12, 2010
I have a gridview displaying "registrationtype id" (FK) from the registration table. I want it to display the related name instead of the id from the registartiontype table.
View 1 Replies
Feb 4, 2010
I have a gridview that has a dropdown on a template on the row. The user is wanting to change the value and update the record automatically. I know that when the value changes, I need to have the OnChange to trigger. I am not sure how to get the row so I can get the record ID so I can create a SQL statement to update this field.
Should I be using something other than the gridview?
View 3 Replies
Jun 17, 2010
I have two gridviews, where the first is databound to a sql table (but does not display the primary key info), and want to filter the data displayed on the second gridview by using the primary key info from the first gridview table, indicated by the selected row in the first gridview - how I could achieve this? its kind of like using the gridviews as a menu and sub menu display!
View 1 Replies
Jan 25, 2011
I have gridview. some columns are data, and some are link buttons. now, I need move these link buttons to a hovermenu. this is done. but I got a javascript exception, and it is because if there is no row was selected in gridview, it will pop this.
so, the question is: how can I select a row in gridview without select command? simply by code?
View 3 Replies
Feb 4, 2011
I am Working on a ASP.net project(VB.net), i have a gridview to display names of "Patients". Each patient has a unique "labID",
I have stored the patients "diagnosis" information in seperate tables( stool,urine, blood etc)
what I need is to retrieve this info when I click on a patients name in gridview.
View 6 Replies
Oct 11, 2010
what is MVC , what is the use of mvc and what i need to learn the MVC, what are the initial requirements for the Learning and MVC is a three tier architecture or not.
View 1 Replies
Jan 19, 2010
I have a basic CMS which I'm adding to a site to display some downloads organised into groups. I have two tables, one for the groups and one for the downloads. I'm using a repeated to display the groups with another repeater inside to display the children. This works perfectly.
However some of my download groups may not have any downloads related to them and I'd like to handle this by filter the groups so that only those with a relate download record(s) are shown.
I'm trying to do this with the query which populates the top repeater based on some ideas I read but I must be going wrong with the syntax.
Here is what I'm using to try and only select downloads groups which have downloads linked to them by the download group ID.
[Code]....
Can anyone offer any thoughts on how I should construct the query to perform this?
View 1 Replies
Mar 31, 2010
I have a Gridview that show the values from mysql database .Can U tell me whn I click on linkbutton on grid view then Display the pop Box nd Data show in textboxes in pop box
id 01
Name GD
Ph 09582901670
View 11 Replies
Nov 29, 2010
I want to make a list of products with gridview01 after gridview01 selected it will appear gridview02 for product specifications. if possible make such a thing?
View 2 Replies
Nov 29, 2010
I want to make a list of products with gridview01 after gridview01 selected it will appear gridview02 for product specifications.if possible make such a thing?
View 2 Replies
Nov 5, 2010
i create example using Northwind database so i create a new website and add new ADO.Net Entity Data Model (.edmx) called Northwind.edmx and i add Categories and Products table inside this (.edmx) file
and add new ADO.Net Data Servuce called "ADODataService" and add it as WebReferences called NorthwindService
so i add new web page and drag DropdownList and Gridview as i want to bind Dropdownlist to all categories and when i select category from Dropdownlist bind Gridview to all Products related to this category
so my code
[Code]....
and my code
[Code]....
so when i select category from Dropdownlist nothing happen :(
also you will find commented code in method BindCategory whuch is not work also.
View 1 Replies
Jul 14, 2010
I'm building a pretty simple application where a user can enter/modify/delete data from a table. Right now, the only field is month, which I'm storing as an integer (1-12). The actual table has more fields but I'm simplifying for the purposes of this question.I have the entry part. For modifying, I've set up a gridview with an 'Edit' button:
[Code]....
The code is putting the gridview row into edit mode. Now, I want to show a dropdownlist of months so the user can select the new month. Also, I would like the dropdownlist to default to the value in the database. I can't figure out how to bind months to the dropdown list ddlMonth.
View 1 Replies
Jan 9, 2010
I am doing a social portal over here. And i have 2 gridviews..
First Gridview which displays all the latest updates a user made and the second gridview which displays the comments made to the latest updates and it is place in the itemtemplate of the first gridview.
The problem now is.. how am i going to locate the 2nd gridview inside the first one? For window components u use FindControl.. But what ever gridview?
View 8 Replies
Aug 6, 2010
I have two gridviews that are in within UpdatePanels each, which are dynamically filled with data and a checkbox column. Clicking on one checkox one of them (Checkbox AutoPostBack = true) , the checkbox column of the other disappears, How to I can handle the state of the gridview.
this is my code:
[code]....
View 3 Replies