tag:blogger.com,1999:blog-6907873803403737979.post1407905458855857053..comments2023-10-16T12:48:46.251+01:00Comments on C# Bits: Dynamic Data Custom PageTemplates with Ajax Control Toolkit Tabs UPDATED: 2008/09/27Stephen J. Naughtonhttp://www.blogger.com/profile/17435527974910745156noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-6907873803403737979.post-44404887020762765592011-06-22T17:50:22.311+01:002011-06-22T17:50:22.311+01:00Hi Numb, I see the project has dissapeared from my...Hi Numb, I see the project has dissapeared from my SkyDrive I will fix this ASAP.<br /><br />Steve<br /><br />P.S. I will be adding this to NuGet Soon.Stephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-56465090131860121452011-06-22T14:33:05.031+01:002011-06-22T14:33:05.031+01:00Where can I download the project?Where can I download the project?Rami Galalhttps://www.blogger.com/profile/00566952798317437326noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-65309747927858765372011-03-10T04:30:29.325+00:002011-03-10T04:30:29.325+00:00Hi Steve,
Thank you very much!
I just want to kn...Hi Steve,<br /><br />Thank you very much!<br /><br />I just want to know if this article is still applicable to 4.0 Framework Dynamic Data Entities.<br /><br />Do you have a sample or a new version? <br /><br />Thanks!Rye Jayhttps://www.blogger.com/profile/11282718342191301996noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-1050719440595228882010-03-19T22:28:12.883+00:002010-03-19T22:28:12.883+00:00Steve,
First of all thanks for all your work and I...Steve,<br />First of all thanks for all your work and I love your articles. I am just getting into Dynamic Data and it looks good. I have done a complete form in an AJAX Tabcontainer in a FormView and using DynamicControl wherever possible. The kick is that I want a two column layout. I have set up all the controls in an HTML table, and when I had finished it all I went to change the TabIndex property on the DyamicControl fields to get the 2 column effect (tab key takes the user down columns, not across rows) when I realised there IS no TabIndex property. Disaster. What do you do when you want a two column layout in a FormView? Am I missing something or will I have to lay it out all over again from scratch?<br /><br />Also, there doesn't seem to be any way to set the width of a DynamicCOntrol field? I tried setting it in the CssClass but it gets overridden by the width of the actual control that is used (i.e. the control in, for example, the Text_Edit template.Catherinenoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-67198813000137926872010-01-07T22:27:35.958+00:002010-01-07T22:27:35.958+00:00This is a bit clearer :)
MetaColumn column;
if (t...This is a bit clearer :)<br /><br />MetaColumn column;<br />if (table.TryGetColumn("foo", out column))<br />{<br /> //TODO: add where parameter<br />}<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-4434608825158221312010-01-07T22:26:16.945+00:002010-01-07T22:26:16.945+00:00Hi Carlos, it is eminantly possible, I have done t...Hi Carlos, it is eminantly possible, I have done this sort of thing using some custom code in the standard page template (List) I would add code that checked to see the table had the filter column using code like this:<br /><br />MetaColumn column;<br />table.TryGetColumn("foo", out column);<br /><br />with this extension method you can if the column is not null you can then apply your filter to the data source by adding a whereParameter.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-35364966245131507472010-01-07T17:01:01.595+00:002010-01-07T17:01:01.595+00:00Mr. Stephen Naughton,
I greatly appreciate your e...Mr. Stephen Naughton,<br /><br />I greatly appreciate your effort and time in trying to contribute with me. Thank you very much.<br /><br />What I'm trying to do is the following:<br /><br />As I am creating a system forr controlling inventory (stock) and sales (billing) for a small company, I have elaborated an ERD which is composed of 140 tables. 52 of them are "reference tables as to keep referential integrity sustained by means of using DropDownLists. <br /><br />On the other hand, one "holding" is composed of different "companies" and each company is divided into "locals". <br /><br />It happens that what I call a "holding" is really a small company which is dedicated to different commercial activities; for instance: a company (let's say Orion)can have three different kind of business (let's say: a hardware store, a pet store and a small pharmacy) <br /><br />I will have registered in my system each one of them as different companies (hardware store = Orion Hardware, Pet = Orion's Pet Shop and Pharmacy = "Orion's Drugstore)<br /><br />Even tough they will reside in the same database, I need that each one of them to look only the part of the database that belongs to each one of them, even tough the administrator or manager or CEO will be able to see and parameterize any company.<br /><br />What I will need to do then is to keep the company code from the login screen and pass it trough all different screens of the system but only using the company code for that specific user that has been logged on.<br /><br />In order to do this, I need to redirect all 52 "mstxxxx" tables to use a screen in which I could pass the value of the company code as to automatically fill the DropDownList with that single value as to show the user that he is using and working data from that specific company. (He wouldn't be able to see any other data from other company)<br /><br />I can achieve this if I were to create in the Custom Templates folder 52 different carpets with the name of the table and of course I'd have a copy of my List.aspx file in every one of the different 52 carpets.<br /><br />I think that I could achieve this by using proper redirecting URL in the global.asax.cs file.<br /><br />Is that possible?<br /><br /><br />Carlos Porras (El Salvador)Análisis Políticos Guanacoshttps://www.blogger.com/profile/08688696992307685070noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-46907042780588892462010-01-07T03:39:30.366+00:002010-01-07T03:39:30.366+00:00Hi Análisis Políticos Guanacos, have you tried the...Hi Análisis Políticos Guanacos, have you tried the sample? And if so does it act the same way?<br /><br />If you would like I can build a sample and send it to you for you to try.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-69483803919849572462010-01-06T23:36:18.153+00:002010-01-06T23:36:18.153+00:00Mr. Stephen Naughton,
I have done in my project a...Mr. Stephen Naughton,<br /><br />I have done in my project accordingly to your instructions (in the global.asax.cs) but even tough URL routing seems to work ok while debugging, it seems that some code generated by dynamic data itself overrides my routing and it uses the standard one so I am unable to use my version "mstList" of the List template.<br /><br />Any idea that might be helpful?<br /><br /><br />Carlos Porras (El Salvador)Análisis Políticos Guanacoshttps://www.blogger.com/profile/08688696992307685070noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-2091651315725737852009-07-29T16:13:40.089+01:002009-07-29T16:13:40.089+01:00Hi John, if you send me an e-mail direct we could ...Hi John, if you send me an e-mail direct we could chat via msn or skype and see what it is you are having difficulty with.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-73917714799439739022009-07-29T16:05:24.940+01:002009-07-29T16:05:24.940+01:00First of all, I want to say thanks--you've bee...First of all, I want to say thanks--you've been a fantastic resource. You probably get this a lot, but here it goes anyway...<br /><br />I was trying to convert your project to VB and was having a little difficulty with the class SubGridViewItemTemplate.<br /><br />In the InstantiateIn subroutine, you declare the subGridTable and sort it.<br /><br />Would you be able to help me with the VB equivilent to the declaring the subGridTables and calling the SubDetails() class?<br /><br />Thanks.<br />--JohnAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-30137494232768730452009-03-30T17:17:00.000+01:002009-03-30T17:17:00.000+01:00You can use the ExtractForeignKey:IDictionary dict...You can use the ExtractForeignKey:<BR/><BR/>IDictionary dict = new OrderedDictionary();<BR/>fkColumn.ExtractForeignKey(dict, selectedValue);<BR/><BR/>to extract the key value pairs.<BR/><BR/>I have a new articles soon which has this in it and may be worth a read.<BR/><BR/>SteveStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-41827707287166887272009-03-30T15:50:00.000+01:002009-03-30T15:50:00.000+01:00ChildrenGrid_Edit can only get the binding paramet...ChildrenGrid_Edit can only get the binding parameter from QueryString. (OnDataBinding)<BR/>How can I apply the DynamicControl binding ???<BR/>(e.g. provide the Binding parameter from other control)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-9893871959554379862008-10-29T17:53:00.000+00:002008-10-29T17:53:00.000+00:00I just ran the first of your four projects. And ye...I just ran the first of your four projects. And yes, I'm not using Linq so your first response sounds correct.WoundedEgohttps://www.blogger.com/profile/10587474211232415755noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-59593273619441506012008-10-29T17:40:00.000+00:002008-10-29T17:40:00.000+00:00Hi Bill, another thought on that Categories thing ...Hi Bill, another thought on that Categories thing I think you may be talking about a different article than this one as the error seems to refer to Filtering and Filtering on any column, is that correct?<BR/><BR/>Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-71814149390709540692008-10-29T17:07:00.000+00:002008-10-29T17:07:00.000+00:00Hi Bill, you said "If I click on "Categories" in y...Hi Bill, you said "If I click on "Categories" in your example project and then "View Products" I get "Invalid Column Name 'Calculated Column'" from line 34 of FilterUserControl.ascx.cs"<BR/>I think you are using Entity Framework and it does not support Calculated Columns this only Works at the moment with Linq to SQL David Ebbo said in a post on the ASP.Net Dynamic Data Forum that the issue is with the EntityDataSource and there has just been released a new Futures entitled PDC preview release here: http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=18764 this may have a workaround.<BR/><BR/>Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-75124029182465013532008-10-29T11:40:00.000+00:002008-10-29T11:40:00.000+00:00Hi Jyoo, you said "Also, how would I control which...Hi Jyoo, you said "Also, how would I control which fields get edited when edit link is clicked in the children tables? Currently I'm using custom edit pages for my tables, which I'm selecting which columns get edited and which are readonly. How do I get that same control?"<BR/><BR/>I would add some new attribute specifically for the SubGrid and then drop those column in the Linq query in the column generator.<BR/><BR/>Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-22660503245243354712008-10-29T11:37:00.001+00:002008-10-29T11:37:00.001+00:00Hi Bill, this version does not need the templates ...Hi Bill, this version does not need the templates folder but in a later article it will. As for the Metadata class the convertion is to use a nested class for the metadata and I've also seen a private interface used as well, but I've not tried that yet :D<BR/><BR/>Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-39936470935977647332008-10-29T11:37:00.000+00:002008-10-29T11:37:00.000+00:00Hi Jhyoo, you will just need to make some changes ...Hi Jhyoo, you will just need to make some changes in the ChildrenGrid FieldTemplate and add a link for the insert. I chose to do it this was as I don't see a need for calling a seperate page for editing the lines. Also I plan to replace the GridView control with the ListView version created in a later article so the inline edit and insert are available.<BR/><BR/>Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-1156255653678873992008-10-29T11:08:00.000+00:002008-10-29T11:08:00.000+00:00If I click on "Categories" in your example project...If I click on "Categories" in your example project and then "View Products" I get "Invalid Column Name 'Calculated Column'" from line 34 of FilterUserControl.ascx.csWoundedEgohttps://www.blogger.com/profile/10587474211232415755noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-69552747904990722602008-10-29T02:17:00.000+00:002008-10-29T02:17:00.000+00:00Steve, in your code, I notice that you have an App...Steve, in your code, I notice that you have an App_code/NW.Metadata.cs and you have a DynamicData/Templates directory. I'm getting a "Resource not found" error on my list.aspx page. I'm wondering...<BR/><BR/>What refers to the Templates directory? Do I need that?<BR/><BR/>In your NW.Metadata.cs file, it looks like you have the metadata and partial classes for three tables. I heard that the convention was to create a separate class file for each table, with the table name as the name of the file. Thoughts?WoundedEgohttps://www.blogger.com/profile/10587474211232415755noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-12715360628091102552008-10-29T01:58:00.000+00:002008-10-29T01:58:00.000+00:00Hi Steve,So I got the first question worked out I ...Hi Steve,<BR/>So I got the first question worked out I asked regarding which tabs and names show up by going through your steps again:).<BR/><BR/>I'm wondering if you had a chance to follow up with the other questions?<BR/><BR/>I'm still trying to figure out how to add a details and an insert link to the children table in the Subgrid View. I noticed in the ChildrenGrid template, the AutoGenerateDeleteButton and AutoGenerateEditButton are set, but there is no AutoGenerateInsertButton.<BR/><BR/>Also is there anyway to control the inline edit on the children tables? Is there anyway to use the field templates like how you would use them with a list, edit, or insert page? Basically I'm trying to get the Subgrid View to look like the standard list page.<BR/><BR/>Thanks in advance:)<BR/>JamesJameshttps://www.blogger.com/profile/04264299327052947051noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-76261623713240246412008-10-28T23:01:00.000+00:002008-10-28T23:01:00.000+00:00I don't quite get Routes. Currently my application...I don't quite get Routes. Currently my application gets a "Resource not found" error looking for:<BR/><BR/>/MyWeb/MyTable/List.aspx<BR/><BR/>I would have thought it should be looking for:<BR/><BR/>/MyWeb/DynamicData/PageTemplates/MyTable/List.aspx<BR/><BR/>?WoundedEgohttps://www.blogger.com/profile/10587474211232415755noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-35076365213154028822008-10-28T22:53:00.000+00:002008-10-28T22:53:00.000+00:00Hi Bill, it is the children table referance in Li...Hi Bill, it is the children table referance in Linq To SQL it should be similar in Entity Framework.<BR/><BR/>Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-37185482179142962562008-10-28T21:34:00.000+00:002008-10-28T21:34:00.000+00:00Steve, in listing 8 you have these lines: [...Steve, in listing 8 you have these lines:<BR/><BR/> [SubGridViews(<BR/> Order = 2,<BR/> TabName = "My Employees")]<BR/> public object Employees { get; set; }<BR/><BR/>Is the "public object Employeees" indicating a child table name of "Employees"? If so, what do I do if my child table has a space in the name? What if the table name were [Employee Territories]?<BR/><BR/>Thanks.<BR/><BR/>Bill RossWoundedEgohttps://www.blogger.com/profile/10587474211232415755noreply@blogger.com