tag:blogger.com,1999:blog-6907873803403737979.post7231371514640877912..comments2023-10-16T12:48:46.251+01:00Comments on C# Bits: Dynamic Data - Hiding Columns in selected PageTemplatesStephen J. Naughtonhttp://www.blogger.com/profile/17435527974910745156noreply@blogger.comBlogger47125tag:blogger.com,1999:blog-6907873803403737979.post-89886869521311643592013-03-12T13:31:36.670+00:002013-03-12T13:31:36.670+00:00Hi Steve,
I'm sorry to hear about your health...Hi Steve,<br /><br />I'm sorry to hear about your health - I hope you are well on the road to recovery! And no apologies ever needed for giving me all this free code and personalized help!<br /><br />I have taken your advice and now I am trying to make the new column generation code work but I'm having a problem. I'm sure you'd rather see any questions about it posted on that page, so I will be posting it there shortly.<br /><br />Thanks again, and get well soon!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-86670260554826434172013-03-10T09:26:43.120+00:002013-03-10T09:26:43.120+00:00hi this should still work but have a look at A New...hi this should still work but have a look at <a href="http://csharpbits.notaclue.net/2010/02/new-way-to-do-column-generation-in.html" rel="nofollow">A New Way To Do Column Generation in Dynamic Data ...</a> this is the better way as this will work for all pages.<br /><br />Steve<br />P.S. sorry for the delay I am recovering from a heart attack and then a triple heart bypass surgery :(Stephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-5067039874523133502013-03-08T19:12:32.096+00:002013-03-08T19:12:32.096+00:00Hi Steve,
Your code is cool as always - usually c...Hi Steve,<br /><br />Your code is cool as always - usually completed for me too, but mostly I understand what's going on here. <br /><br />However, I'm having a problem - its vb.net (vs 2010) so I don't know if you care to deal with this, but here it goes:<br /><br />I'm trying to implement this on a page List but the GenerateFields function in the HideColumnFieldsManager Class never fires. The constructor for the class does, though. I'm at a loss for ideas (I converted all your code to vb.net via a conversion utility on the web). I had to convert the extensionmethods class to a module because the converter added this above the IsHidden function: _, but ishidden is called from GenerateFields so I don't think that is the problem and I tried it as a clss w/o the compiler stmt & it didn't work either.<br /><br />I'd appreciate any ideas<br />Thanks, so much!<br /><br />JohnAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-5232495103853715672010-07-21T15:16:25.065+01:002010-07-21T15:16:25.065+01:00have a look at this article here A New Way To Do C...have a look at this article here <a href="http://csharpbits.notaclue.net/2010/02/new-way-to-do-column-generation-in.html" rel="nofollow">A New Way To Do Column Generation in Dynamic Data 4</a><br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-54036209717509165152010-07-21T15:06:08.304+01:002010-07-21T15:06:08.304+01:00Hi Steve,
I'm using DD4 in VS2010. FormView d...Hi Steve,<br /><br />I'm using DD4 in VS2010. FormView doesn't have ColumnsGenerator property. Do I have to extend the FormView?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-71955253016094854812010-07-13T10:59:46.131+01:002010-07-13T10:59:46.131+01:00Hi Anonymous, this is not compatible with DD4 and ...Hi Anonymous, this is not compatible with DD4 and VS2010 you need to look at <a href="http://csharpbits.notaclue.net/2010/02/new-way-to-do-column-generation-in.html" rel="nofollow">A New Way To Do Column Generation in Dynamic Data 4</a> DD4 uses Entity Templates which rely on FormView which you can use FormView1.ColumnsGenerator =<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-23286179679666207512010-07-13T10:00:55.463+01:002010-07-13T10:00:55.463+01:00hi,
in VS 10 Page_init of DD need dictionary param...hi,<br />in VS 10 Page_init of DD need dictionary parameter.<br /> table = DynamicDataRouteHandler.GetRequestMetaTable(Context);<br />GridView1.SetMetaTable(table,<br />table.GetColumnValuesFromRoute(Context));<br /><br />I didn't succeed to work around it...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-9852794425716841552010-07-06T00:32:46.912+01:002010-07-06T00:32:46.912+01:00You could use the Action from the route to find ou...You could use the Action from the route to find out which page it is, I'll look into it for the next version (DD4 versoin)<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-732256238670504842010-07-05T22:30:33.935+01:002010-07-05T22:30:33.935+01:00Hi Steve, excellent blog. I'm experimenting wi...Hi Steve, excellent blog. I'm experimenting with Dynamic data, and you're code's been very handy making the who scaffolding side of things at all useful.<br /><br />One query: I've noticed in hiding columns, if the page for example is '/Companies/List.aspx', the columns hide, but '/Companies/list.aspx' does not. I've worked around this by adding the lower case version to the PageTemplate enum like so:<br /><br />List = 0x08,<br />list = 0x08,<br /><br />Is there a nicer way to make it not case sensitive?Matthew Paulnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-12825956435560089672010-06-25T11:27:27.529+01:002010-06-25T11:27:27.529+01:00Hi Brian, I think it should look like this:
Public...Hi Brian, I think it should look like this:<br />Public Sub New(ParamArray lookupTable As PageTemplate()) <br /> PageTemplates = lookupTable <br />End Sub <br /><br />For that method.<br /><br />SteveStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-2175276605867055422010-06-25T04:59:38.693+01:002010-06-25T04:59:38.693+01:00Hi,
I am trying to implement this in vb.net and h...Hi,<br /><br />I am trying to implement this in vb.net and having an issue. I know this is C# bits, but perhaps you can help. My problem is passing the array of PageTemplates in the partial class. VB doesnt allow the declaration of an Array the same way C# does and every other way i try to declare the array i get compile time error about "Contant expression is required" How can I pass this list of PageTemplates to the attribute class?Unknownhttps://www.blogger.com/profile/02348059340088036935noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-85977962304974925792010-06-02T11:17:49.858+01:002010-06-02T11:17:49.858+01:00Sorry Philip I don't quite understand what it ...Sorry Philip I don't quite understand what it is you want...<br /><br />Steve :)<br /><br />Drop me an e-mail, my address is at the top of my blog.Stephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-67124673134519914142010-06-02T09:23:02.159+01:002010-06-02T09:23:02.159+01:00what would be the current one to expand the things...what would be the current one to expand the things over to experience?<br /><br />Philip<br /><a href="http://www.viteb.com/website-development/" rel="nofollow">Web Based Application Development</a>Unknownhttps://www.blogger.com/profile/14245041487481348578noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-68950533354914777402010-01-15T18:24:45.178+00:002010-01-15T18:24:45.178+00:00You rock - thank you for this solution, it worked ...You rock - thank you for this solution, it worked great.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-72060234991433696952009-12-17T23:08:51.049+00:002009-12-17T23:08:51.049+00:00Hi I've got dosens of projects using HideColum...Hi I've got dosens of projects using HideColumnIn. I can send you aworking sample that uses Northwind for you to test, just send an e-mail to the e-mail address on my blog.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-80668528790159553012009-12-17T21:46:03.808+00:002009-12-17T21:46:03.808+00:00Hi Steve,
I tried this and it works perfect, but ...Hi Steve,<br /><br />I tried this and it works perfect, but it's messing up the paging on the List.aspx page. Any ideas?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-44875302334103243032009-12-15T13:36:33.414+00:002009-12-15T13:36:33.414+00:00Sorry but without understanding your schema I can&...Sorry but without understanding your schema I can't tell why this would be.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-29637979122081629762009-12-15T08:40:16.945+00:002009-12-15T08:40:16.945+00:00Hi
I have used your code for to hide the columns ...Hi<br /><br />I have used your code for to hide the columns only in insert.aspx page......but there is a problem....don´t save the new data (it´s a datetime)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-56438943625641917162009-10-08T18:44:35.611+01:002009-10-08T18:44:35.611+01:00Goo glad you sorted it.
Steve :DGoo glad you sorted it.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-71575245089624985152009-10-08T15:55:44.083+01:002009-10-08T15:55:44.083+01:00Just to let you know, I was just missing a System....Just to let you know, I was just missing a System.Web reference in my DAL project....Monanoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-22705172427416115672009-10-06T13:32:40.460+01:002009-10-06T13:32:40.460+01:00I can't see why you can't and I don't ...I can't see why you can't and I don't understand the error you are getting is sounds like there is a namespace issue because HideColumnFieldsManager implements IAutoFieldGenerator.<br /><br />But again I thinks this should be doable.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-68697196331366731172009-10-06T12:20:11.346+01:002009-10-06T12:20:11.346+01:00Thank you for this article (and all the others!).
...Thank you for this article (and all the others!).<br /><br />I have implemented Dynamic Data across my DAL and my presentation layer. I had to add the Attribute class in my DAL so I could refer to it in my classes that represent each tables. But I had to insert the IAutoFieldGenerator in my presentation layer ortherwise the line for ColumnsGenerator wouldn't compile ("Cannot implicitly convert HideColumnFieldsManager to IAutoFieldGenerator"). Do you think it is possible to add this class in the DAL as well? Because now I have dependency between my presentation and my DAL. Thanks!Monanoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-29381943251100525702009-09-23T10:29:26.858+01:002009-09-23T10:29:26.858+01:00I usually create a custom filter either using the ...I usually create a custom filter either using the filtering provided by the Old Futures project which had all the source, of using Preview 4 DD v2 bits. I hide the filter but still return the filter value.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-30395944377662563592009-09-22T17:05:13.648+01:002009-09-22T17:05:13.648+01:00Is there exist a similar method to hide data rows ...Is there exist a similar method to hide data rows ?<br />For example is I want to display only rows whose "isActive" attribute is set to True.<br /><br />Thx.Davidnoreply@blogger.comtag:blogger.com,1999:blog-6907873803403737979.post-30964609230630272352009-08-24T16:42:56.740+01:002009-08-24T16:42:56.740+01:00Hi David, drop me an e-mail and I think I can give...Hi David, drop me an e-mail and I think I can give you an idea or two to help streamline this.<br /><br />Steve :DStephen J. Naughtonhttps://www.blogger.com/profile/17435527974910745156noreply@blogger.com