.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Change Default Sort for Dynamic Data Web Application

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net



I just created a dynamic data web application and setup a simple .EDMX file. Next, I created meta-data / partial classes to ensure that my integer identifiers wouldn't show up:

// ...


public object TableId { get; set; }

 // ...

I wanted to now set the up the list pages so they sort using a different attribute ("Name" in this case). Anyone know if this is possible / how to do it?






View Complete Post

More Related Resource Links

What is a good example Dynamic Data application?


I'm giving a demonstration of Dynamic Data to a bunch of geeks in two weeks time. I'm looking for a simpe, but comprehensive data model to build the application on. I basically just want to register the model and demonstrate the application, as built (scaffolded) without any customisation, to start with, demonstrating list and detail/edit/insert views, and how table relations are handled.

I'd like to avoid one of the standards, i.e. the Customer->Order-OrderItem models, and try something that would be of interest to geeks. Maybe a Srum project tracker, an or a bug tracker, something like that.

Any suggestions please?

This was originally asked by myself on StackOverflow at: http://stackoverflow.com/questions/3536803/what-is-a-good-example-dynamic-data-application

Automatically set a property value for a new record in a Dynamic Data application.


I have a SalesOrderItem table, and it has a UnitPrice column in case the salesperson wishes to override the unit price of the Product for that order item.

In an ASP.NET Dynamic Data application, what would be the best way to set that UnitPrice property on a new SalesOrderItem based on the standard UnitPrice for the product? In other words, when the user clicks New on the 'Items' screen for a sales order, the UnitPrice field should already be filled in with the normal unit price for the product.

This was originally asked by myself on StackOverflow at: http://stackoverflow.com/questions/3538234/automatically-set-a-property-value-for-a-new-record-in-a-dynamic-data-application

Dynamic Data Entity Framework: Initial Sort Order for Views

Hello Steve,I'm trying to set an initial sort order for my View (not table) in Dynamic Data using Entity Framework 2. I have updated my Model and Imported the View. Now I'm trying to use the DisplayColumn attibutebut it's not working.[DisplayColumn("Product", "ParsingOrder", true)]Fabio

Inserting methods in Dynamic Data Application


I am trying to build aa hotel management application using Dynamic data. I need to create an event and add methods to calculate applicable room charges based on the duration of stay. For example;

TotalRoomCharge = DurationOfStay*RoomRate

TotalRoomCharge, DurationOfStay and RoomRate are all columns in my database table.

I have already generated the dynamic data site in my application.

How do I change what Data ASP.NET dynamic data gets from the DB?


I want to lock down the data that ASP.NET DD gets from the database based upon who is logged in.

Is there a standard or recommended way to filter the data that DD pulls from the database based upon a session variable or something like that?

i.e. I only want to get data from table A where the user logged in has permission to get the data from table A (table A has a relationship to my users table)

Change Dynamic Data database connection string


I have recently started to learn Dynamic Data Web application.

I have built a Dynamic data Website with LINQ data access layer. When the LINQ data context was built over an existing SQL2005 database, the connection string for that database was correctly, automatically, placed into the Settings and .edmx Code for the project. It works, but it's a "static" connection string.

I would like to be able to use this one LINQ data access layer against both test and production databases without having to manually change and recompile the project's connection string each time.

Is there a way to pass/change the User connection string to the LINQ data access layer at Run Time so that destination database changes? Ot in Other words How can user can choose a database from a list of databases.


Dynamic Data Field template edits - Tooltip text, Dynamic Data Page template edits - field sort


I have an ASP.net website build in VB 2010 web dev pro using 4.0 framework.  Its a dynamic data site and I am having some trouble formating some of the field and page canned templates.

Q1: Field Templates - the tooltip code (TextBox1.ToolTip = Column.Description) is within the ascx.vp pages for each of the field templates.  Where can I update each columns description (as the code references) so the tooptip will be column/field specific.  If its not as straight forward as that, I was trying to write an if/else statement because the tooltip code is set at the field type level (decimal, date, etc) and I want it to be column specific.  example;

if column.value = Financial Impact

then  TextBox1.ToolTip = "enter financial impact in whole dollars"

else TextBox1.ToolTip = "next fields tooltip text"



assign default value to dynamic data field



I have the script below and I want to apply a default value to the DynamicField StudentId (please see line in bold) below. Can anyone tell me how to do so?




        <asp:GridView ID="GridViewGuardians"  runat="server" SelectedIndex="1"
            AutoGenerateColumns="false" DataKeyNames="StudentGuardianId" DataSourceID="LinqDataSourceGuardians" ShowHeader="true" ShowFooter="True">
                   <asp:LinkButton  ID="lbInsertGuardianG" runat="server" CommandName="Insert" ValidateionGroup="addValidationGuardian" OnClick="lbInsertGuardianG_Click" >Insert</asp:LinkButton>

Creating Custom Page in Dynamic Data Application


To create a custom page I copied the List.Ascx file from the Page templates to DynamicData\CustomPage\"MytableName"

I keep getting the follwing errors mainly in list.aspx.designer

"The type 'L2SDynamicData.List' already contains a definition for GridView1"

"The type 'L2SDynamicData.List' already contains a definition for table1"

"The type 'L2SDynamicData.List' already contains a definition for HeadContent"

"The type 'L2SDynamicData.List' already contains a definition for DynamicDataManager1"

"The type 'L2SDynamicData.List' already contains a definition for UpdatePanel1"


There are about 32 of these error types



Creating Custom Page in Dynamic Data Application


To create a custom page I copied the List.Ascx file from the Page templates to DynamicData\CustomPage\"MytableName"

I keep getting the follwing errors mainly in list.aspx.designer

"The type 'L2SDynamicData.List' already contains a definition for GridView1"

"The type 'L2SDynamicData.List' already contains a definition for table1"

"The type 'L2SDynamicData.List' already contains a definition for HeadContent"

"The type 'L2SDynamicData.List' already contains a definition for DynamicDataManager1"

"The type 'L2SDynamicData.List' already contains a definition for UpdatePanel1"


There are about 32 of these error types



Updating Data-Tier Application project after schema change has been made in SSMS

I have successfully created a Data-Tier Application project within visual studio. How do I update these scripts to reflect the changes made by a DBA in SSMS?  Also, on another project we use Entity Framework which drops and recreates the database from within the application. I would also like to import these changes into the Data-Tier Application project.
I can figure out how to import the database into the project the very first time. But after a change has been made using another tool, how do I synchronize the project in visual studio?
When I create a schema comparison that points from database -> project, it correctly analyzes the schema changes. Am I missing how to update the project with these changes?
Thanks, I really would like a solution to this so I can use Data-Tier Applications instead of a third party tool.

Dynamic Data Templates in GridView ASP.NET 3.5

At a high level, Dynamic Data Templates can be seen as a system to very quickly build up a User Interface linked with the relevant data model, immediately enabling you to perform CRUD operations (Create, Read, Update, Delete) on the database using the specified data source. They provide a powerful method for building up these kinds of applications, and I'm going to focus on an overview of what Dynamic Data Templates actually are, and a few ways of customizing them to suit industry needs.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

ASP.NET 4.0 Dynamic Data and Many to Many Entity Framework Entities

I did not play much with Dynamic Data controls in VS2008 and just made a cool discovery in VS2010 Beta 2. This may not even be new, but as I'm sitting 30,000+ feet over the Atlantic ocean, I don't have access to VS2008 at the moment to check.

Creating a Smartphone Application and Using Data from SQL Mobile

In this exercise, you will use Visual Studio 2005 to create a Smartphone application. You will associate commands with a mobile device's soft keys, and you will add the ability to scroll through the list of available products (a list of images). You will create a data source for an existing SQL Mobile database, and then test the application in the Windows Mobile 5.0 emulator.

In the following procedure, you will create a new Windows Mobile 5.0 project in Visual Studio.



Dear gentlemen and ladies of the Microsoft Dynamic Data Team,

Mr. Steve Naughton says (and I hope so) that there might be chances that you read the posts published in this forum: I really hope so.

If that were the case then I am formally requesting to you in providing a "real answer" to my question:

I want to customize a dynamic data page (the details one) so I can have access to the data it has been already gathered from the end user UI (details.aspx) and use it to pass this same data to the following controls/pages that I am going to display next time to the end user.

For instance:

I have a screen with different types of data in it: texts, numbers, dates, check boxes, radio buttons and dropdownlists that has been filled with data by the end user. I want now to reset all fields exept the dropdownlist of which I'd like to keep the previously chosen values(the very same thing you do between dropdownlist of List.aspx ad Details.aspx). Even with FoxPro I could do that because data and controls were available there. It was as simple as setting carrying on to true.


I have found my

How to change the default page base class?


I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.

I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend