Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:864395
More Search Options
RSS Available
Matching Posts
Re: Multiple foreign keys from the same table issue with DynamicField
Thanks - I have just realized this by looking at the generated code. I had previously read somewhere that to make the dynamic field work with a foreign key, set the datafield value to the name of the foreign key table, and normally this works. However in fact as you point out the datafield value is set to a property of the generated class, which is by default the same as the table name, and if you add a second relationship the second property is generated as TableName1 as you point out.
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/29/2009
Re: Multiple foreign keys from the same table issue with DynamicField
Thanks to the two replies so far but I don't think either of them has addressed the issue. There is a table Articles with two fields (AuthorID and EditorId) Both of these fields are ID from the SAME User table, ie both the Author and the Editor are members of the User table. Foreign keys are set up between Articles.AuthorId and User.UserId and Articles.EditorId and User.UserId if you add a dynamic field to the GridView that is using the ForeignKey UIHint, the datafield needs to be set to the
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/29/2009
Multiple foreign keys from the same table issue with DynamicField
I have a table with two foreign keys which both get their primary key value from the same table. Each record has an author and an editor field, which are obtained from a Users table. When I try to add both fields as dynamic fields to the Grid View control, the DataField attribute needs to be set to the User table to get the Foreign Key to work, but I can only get it to display the first field twice (i.e the Author field is displayed twice). How do I indicate that the second field should get its value
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/29/2009
Filed under: dynamic controls, Dynamic Data, Dynamic Fields, DynamicControl
Re: How to override default insert method of Details View in Dynamic Data
Does exactly what it says on the tin!
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/21/2009
Re: How to override default insert method of Details View in Dynamic Data
Steve, I'm not sure how I would reference it, but I have found that in DetailsDataSource_Inserted the eventargs contains a Result object which is the returned value, which can be cast to the object type and contains the returned ID. Thanks for your help!
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/21/2009
Re: How to override default insert method of Details View in Dynamic Data
Steve, Thanks for the reply, the article was very helpful, I can now use the stored procedure to insert the information with the returned value added to the passed in instance. However it is still not clear how to access this from the DetailsView_ItemInserted method. In the DataContextClass the generated code is: Private Sub InsertArticle( ByVal obj As Article) Dim p1 As System.Nullable( Of Integer ) = obj.ArticleId Me .fgp_InsertArticle(p1, obj.HTMLPageName, obj.Title, obj.Summary, obj.PageContent
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/21/2009
How to override default insert method of Details View in Dynamic Data
I would like to change the default method of inserting data to make it use a stored procedure, plus I would like to get a return value from this stored procedure returned to the calling code. Scenario is that on insert the default behaviour is to go to the list view, but I would like to get from the insert the autogenerated primary key and use this to re-direct to a different form showing the newly inserted record. I see that I can create a partial class for the DataContext class and then create
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/20/2009
Filed under: Dynamic Data
Re: Accessing Dynamic Data Fields in code
The reason to access the field was to set force the values of some fields dynamically. I have since discovered that by changing it to a template field that this is possible, however it seems a bit of a round about way to do it, given that the field exists and is there. Also I anticipate that if I want to do this, there may be other requirementes in the future hence the question.
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/20/2009
Accessing Dynamic Data Fields in code
If I have a DetailsView, how can I access the underlying controls (e.g. TextBox) that make up the dynamic fields. E.g. < asp : DetailsView ID ="DetailsView1" runat ="server" DataSourceID ="DetailsDataSource" DefaultMode ="Insert" AutoGenerateInsertButton ="True" OnItemCommand ="DetailsView1_ItemCommand" OnItemInserted ="DetailsView1_ItemInserted" CssClass ="detailstable" FieldHeaderStyle-CssClass ="bold"
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/18/2009
Filed under: dynamic controls, Dynamic Data
Re: Dynamic Data Validation Unhandled Exception
Steve, The answer seems to be to create a member variable in the Partial Class, and in the fields OnFieldChanging event you can store the current value in the member variable. Then in OnValidate you can compare the new value (which has been written in the original member variable) to the value stored previously. e.g. assume a table Articles with a field EditStatus (which is a Foreign Key) Partial Public Class Article REM needs to be private or protected not public or you will get a LINC error Protected
Posted to
ASP.NET Dynamic Data
(Forum)
by
zorgit
on 4/11/2009
Page 1 of 2 (16 items) 1
2
Next >
WindowsClient:
Windows Client Developer Roundup for 12/28/2009
WindowsClient:
Snoop with 64 bit support
ASP.NET:
jQuery Hide/Close Link
ASP.NET:
Merry Christmas
TechNet Edge:
FPE Customer Story
Silverlight:
Being a writer, and having an editor. A Short Rant.
Channel 9:
Channel 9 Live at PDC09: Dr Brian Brooks (3M)
Channel 9:
C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals Chapter 13 of 13
Silverlight:
Information for Silverlight HVP Developers…
WindowsClient:
Custom Content Loaders in Silverlight 4.0
WindowsClient:
MVVM Links\Info
TechNet Edge:
Check out how Dolly Parton uses IE8 and Web slices!!!
Silverlight:
A Silverlight HVP Update
Channel 9:
Channel 9 Live at PDC09: This Week on Channel 9 - PDC09 Daily Show Edition Day 1
Channel 9:
Maria Klawe: Scholar, Scientist and Microsoft Board Member
Channel 10:
Play the Bing Sherlock Holmes Game
Channel 9:
Channel 9 Live at PDC09: Loic Le Meur
Channel 10:
How to Delete Jump List Items
Channel 10:
Roll Back to Classic Network Indicator in Win7
Channel 9:
Jafar Husain: Silverlight Toolkit and Rx, Part 2
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online