tag:blogger.com,1999:blog-6907873803403737979.post4590545570245779716..comments2023-10-16T12:48:46.251+01:00Comments on C# Bits: Hiding Foreign Key column Globally in Dynamic DataStephen J. Naughtonhttp://www.blogger.com/profile/17435527974910745156noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-6907873803403737979.post-85010861056323117392011-10-26T12:09:04.177+01:002011-10-26T12:09:04.177+01:00Hi Waqar, not sure what you want here please email...Hi Waqar, not sure what you want here please email me direct and I will see if I can help.<br /><br />SteveStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-15532085901689183852011-10-25T17:37:48.400+01:002011-10-25T17:37:48.400+01:00Steve I have a problem.
I want to show a data colu...Steve I have a problem.<br />I want to show a data column instead of foreign key in dynamic data site. How can I achieve this ?<br />Please Help meWaqar Farooq Janjuahttps://www.blogger.com/profile/11696329603430139585noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-16121974470408843702009-05-23T18:45:46.521+01:002009-05-23T18:45:46.521+01:00I do not believe it is or in VS2010 and .Net 4.0 B...I do not believe it is or in VS2010 and .Net 4.0 Beta 1 either. However this should work without problem in the Preview 4 and Beta 1.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-58002289534282432502009-05-23T18:24:05.188+01:002009-05-23T18:24:05.188+01:00Is this functionality built into Preview 4 since t...Is this functionality built into Preview 4 since the options exists to add different column to the filters. Would you recommend just starting with preview 4 since I am just starting out.Unknownhttps://www.blogger.com/profile/02724520347990955965noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-13963814107028592602009-05-23T09:21:01.002+01:002009-05-23T09:21:01.002+01:00Hi I think you want to use this post here for limi...Hi I think you want to use this post here for limiting which filters are shown on a page: http://csharpbits.notaclue.net/2008/05/dynamicdata-limit-filter-fields.html<br />This is for .Net 3.5 SP1 DD not Preview 4 or VS2010 Beta 1 I will have a look at doing a version for Beta 1 if there is any interest.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-73162221619175921132009-05-23T06:02:49.071+01:002009-05-23T06:02:49.071+01:00Great post! I am new to DD, and your blog has been...Great post! I am new to DD, and your blog has been in-valuable to me in learning about what is going on under the hood. So thanks! I have the FK hidden in the grid using the code listing and it works as expected, but the FK is still being auto generated as a dynamic filter which I don’t want either. Can you point me in the right direction for handling this issue?Unknownhttps://www.blogger.com/profile/02724520347990955965noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-60055897028885543152009-05-14T09:56:00.000+01:002009-05-14T09:56:00.000+01:00Hi Ashfaq, tht's real weired because that's the re...Hi Ashfaq, tht's real weired because that's the recomended way nesting the classes. Have a look at those created byt DomainService.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-53958279309581251222009-05-14T01:30:00.000+01:002009-05-14T01:30:00.000+01:00Sorry...I felt asleep.What I wanted to say is that...Sorry...I felt asleep.What I wanted to say is that When I put [ScaffoldColumn(false)] on Order object on your class, it was still showing Order Relational Column on Employee Table. But if I arrange your class like <br /><br />[MetadataType(typeof(EmployeeMM))]<br />Public partial class Employee<br />{<br />}<br /><br />Public class EmployeeMM<br />{<br /> [ScaffoldColumn(false)]<br /> Public object order{get;set;}<br />}<br /> it was not showing Order Relational column(which is desired), So My question is why Order column was showing when I put [ScaffoldColumn(false)] on your class. And also I made a class Order in my way and set [HideFKColumn(true)] on that class, it didn't work. And finally...it seems that to Hide FK column I have to make individual class and set [HideFKColumn(true)] for those class, but is there any way so that I can set [HideFKColumn(true)] to any place for once and that will stop showing all FK column in all Table. I just need to Hide all FK column from All Table? I have just woke up and typing without my glass even..so sorry If I make any typing mistake:).Ashfaqnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-76095935760557157512009-05-12T09:57:00.000+01:002009-05-12T09:57:00.000+01:00I Ashfaq, if you look at the NW.Metadata.cs file a...I Ashfaq, if you look at the NW.Metadata.cs file and the entity it is on it means where ever a product exists it will hide FK to that table instead of hiding using [ScaffoldColumn(false)] each place it occurs.<br /><br />So you put<br />[ScaffoldColumn(false)]<br />on the FK column and you put<br />[HideFKColumn(true)] <br />on the FK Table<br /><br />does that make sense now?<br /><br />Steve :D<br /><br />P.S. you can always use Digsby on this page to chat to me if you like when I'm online :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-37058811722570218162009-05-12T05:05:00.000+01:002009-05-12T05:05:00.000+01:00Thanks for your quick response, I saw your NW.Meta...Thanks for your quick response, I saw your NW.Metadata.cs class and saw there [HideFKColumn(true)] attribute is set. So according to my understanding, when I will click on Employee Table in DD Grid, the Employees List page will Populate all column except the relational column[EmployeeTerritories, Orders, Employees]. But it is still populating those Relational column, I watched the Video link and exclude your Metadata.cs class and made my own partial Class named "Employee" and set [HideFKColumn(true)] to that for testing, but that didn't work also...still showing Relational Column for Employees.What I am missing?<br /><br /> I want a generic way to turn off Relational Column from populating for all Tables. If I have to make partial Class for all the Tables that will be little time consuming for my purpose. <br /><br />Thanks for your Time <br /><br />AshfaqAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-60547838573652241412009-05-11T14:05:00.000+01:002009-05-11T14:05:00.000+01:00If you open the project and look in the App_Code\N...If you open the project and look in the App_Code\NW.Metadata.cs file you can see it in use there. You apply the attribute to the metadata classes, see this http://www.asp.net/learn/3.5-SP1/video-291.aspx for more info on setting up metadata.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-20098882606841677542009-05-11T11:20:00.000+01:002009-05-11T11:20:00.000+01:00Hei...I couldn't find out the way yet, from where ...Hei...I couldn't find out the way yet, from where I should set the property FkIsHidden, I need to remove/hide all the FK column in my ListDetails.aspx/or List.aspx page:(.<br /><br />AshfaqAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-73902426378290510482009-05-11T10:06:00.000+01:002009-05-11T10:06:00.000+01:00Wow...that is quick response...I was working on th...Wow...that is quick response...I was working on that and you just uploaded the files.Thanks I will be always grateful to you if that works..let me try now.<br /><br />Thanks in Advance:)<br />AshfaqAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-24669151011091852842009-05-11T09:47:00.000+01:002009-05-11T09:47:00.000+01:00I just added a download for the project.
Steve :D...I just added a download for the project.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-34137244104681990322009-05-11T09:33:00.000+01:002009-05-11T09:33:00.000+01:00Sure just drop me an e-mail
Steve :DSure just drop me an e-mail<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-24471158078226454312009-05-11T07:03:00.000+01:002009-05-11T07:03:00.000+01:00Hei...can I have sample project to download so tha...Hei...can I have sample project to download so that I can place the code in correct place to make this thing work.I am new to DD and need to hide FK column from my pages globally.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-31368298011264088132009-04-27T14:35:00.000+01:002009-04-27T14:35:00.000+01:00Hi Steve,
I'm working on a dynamic data project.
R...Hi Steve,<br />I'm working on a dynamic data project.<br />Requirement:<br /><br />Table: Customer<br />Column1:ReviewDate (datetime)<br />Column2:Review (boolean)<br /><br />Rules:<br /><br />1)By default "ReviewDate" column hidden or readonly in "Edit" mode.<br />2)When click "Review" checkbox ticked i want to show the "ReviewDate" column with editable text field to enter datetime.<br />3)once i enter the value in "ReviewDate" field i want "ReviewDate" and "Review" fileds to be readonly.<br /><br />I tried different work arounds but no luck.<br /><br />Please give me one example code to accomplish this task.Anonymousnoreply@blogger.com