Data Scaffolding using ASP.NET Dynamic Datahttp://forums.asp.net/1145.aspx/1?Data+Scaffolding+using+ASP+NET+Dynamic+DataDiscussions regarding the Dynamic Data scaffolding framework in ASP.NETSat, 11 May 2013 20:04:02 -0400urn:uuid:00000000-0000-0000-0000-000000001145urn:uuid:00000000-0000-0000-0000-000005393674http://forums.asp.net/p/1905977/5393674.aspx/1?Dynamic+Data+Data+Encryption+SortingDynamic Data - Data Encryption - Sorting <p>Issue Type: Sorting</p> <p>I've erected an application with Dynamic data model which ciphers the data from/to the data source. The Field templates in place and the filters do their Job well and good and even the foreign key filters work like a charm. The trouble is with sorting.</p> <p>The data field from source is an encrypted text and the grid seems to use this to sort the data. Is there ANY way to use the Decrypted text to perform the sort? The Encrypt and Decrypt actions are handled with simple methods.</p> 2013-05-14T14:51:21-04:002013-05-14T14:51:21.76-04:00urn:uuid:00000000-0000-0000-0000-000005395870http://forums.asp.net/p/1906478/5395870.aspx/1?Dynamic+Data+DataAnnotations+setting+dynamically+using+t4+templateDynamic Data DataAnnotations setting dynamically using t4 template <p>Hi,</p> <p>Is there any way to set dynamically the dataannotations according to some values in database?</p> <p>My requirement is like this:</p> <p><strong>Display(Name=&quot;DispName&quot;)]</strong></p> <p><strong>&nbsp;public string DName{get;set;}</strong></p> <p>&nbsp;Instead of hardcoding Name=&quot;DispName&quot; for Display DataAnnotation, I want to fetch some value from DataBase and fit int the Name attribute. like:</p> <p><strong>&nbsp;[Display(Name=SomeValueFromDB)] </strong></p> <p><strong>public string DName{get;set;}</strong></p> <p>This should be done using t4 template also. Is there any way to accomplish this?</p> <p>Regards,</p> <p>Sujith</p> 2013-05-16T11:45:53-04:002013-05-16T11:45:53.697-04:00urn:uuid:00000000-0000-0000-0000-000005395191http://forums.asp.net/p/1906326/5395191.aspx/1?How+to+create+a+custom+filter+templateHow to create a custom filter template <p>I am building a Student Information System which allows different roles to log in. When a Teacher logs in I want them to be able to access only students in the class that they teach. A Class may have one or more Students. When the Teacher accesses the StudentAttendance &quot;gridview&quot; which does not have a ClassID I want to show only Students who belong to the Class that the Teacher teaches. The StudentAttendance table has the following fields: ID, StudentID, Date, Present, Late. I have a TeacherClass table: ID, TeacherID, ClassID. Also There is a ClassStudent table: ID, ClassID, StudentID, AcademicYear. So via SQL I can easily determine the Students in a specific class taught by a specific Teacher.</p> <p>Please help.</p> 2013-05-15T21:02:57-04:002013-05-15T21:02:57.38-04:00urn:uuid:00000000-0000-0000-0000-000005238215http://forums.asp.net/p/1865669/5238215.aspx/1?Dynamic+Data+ListDetails+aspx+Entity+DataDynamic Data: ListDetails.aspx - Entity Data <p>Hi,</p> <p>&nbsp;</p> <p>How do I get the column information, i.e. the actual rows and columns and the data within from the ListDetails.aspx (is it possible from the metatable)?</p> 2012-12-13T08:52:25-05:002012-12-13T08:52:25.633-05:00urn:uuid:00000000-0000-0000-0000-000005383155http://forums.asp.net/p/1903494/5383155.aspx/1?A+Field+is+AWOLA Field is AWOL <p>The problem is with the HomeWork table the Class does not show although the Subject does.</p> <p>I have three tables:</p> <p>1. Class: ID, Name, TeacherID</p> <p>2. ClassStudent: ID, ClassID, StudentID</p> <p>3. HomeWork: ID, ClassID, SubjectID, DateGiven, DueDate, Details</p> <p>A Class may have one or more Students and One or more Studens may be in a Class. A Class can be given one or more items of HomeWork.</p> <p>Here is the code:</p> <p>sisDomainService.metadat.cs:</p> <pre class="prettyprint">internal sealed class HomeWorkMetadata { // Metadata classes are not meant to be instantiated. private HomeWorkMetadata() { } public Class Class { get; set; } public long ClassID { get; set; } [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = &quot;{0:d}&quot;)] [DisplayName(&quot;Given Date&quot;)] public DateTime DateHWGiven { get; set; } [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = &quot;{0:d}&quot;)] [DisplayName(&quot;Due Date&quot;)] public DateTime DueDate { get; set; } [DisplayName(&quot;Details&quot;)] public string HomeWorkDetails { get; set; } [ScaffoldColumn(false)] public long ID { get; set; } public Subject Subject { get; set; } public long SubjectID { get; set; } } }</pre> <p>sisDomainService.cs:</p> <pre class="prettyprint">[RequiresAuthentication] [RequiresRole("Clerk","Teacher", "Principal", "Student", "Parent")] public IQueryable&lt;HomeWork&gt; GetHomeWork() { if (this.ServiceContext.User.IsInRole("Student")) { int intClassID = getClassID(); return this.ObjectContext.HomeWork.Include("Class").Include("Subject").Where(s =&gt; s.ClassID == intClassID).OrderByDescending(s =&gt; s.ID); } if (this.ServiceContext.User.IsInRole("Parent")) { List&lt;int&gt; intListofStudentIDs = new List&lt;int&gt;(); intListofStudentIDs = getStudentIDs(getParentID()); List&lt;int&gt; intListofClassIDs = getClassIDs(intListofStudentIDs); return this.ObjectContext.HomeWork.Include("Class").Include("Subject").Where(s =&gt; intListofClassIDs.Any(i =&gt; i == s.ClassID)).OrderBy(s =&gt; s.ClassID); //Where(s =&gt; intListofStudentIDs.Any(i =&gt; i == s.StudentID) } return this.ObjectContext.HomeWork.Include("Class").Include("Subject").OrderByDescending(h =&gt; h.ID); }</pre> <p>Please help thank you.<br> <br> <br> </p> 2013-05-03T09:31:20-04:002013-05-03T09:31:20.233-04:00urn:uuid:00000000-0000-0000-0000-000004888994http://forums.asp.net/p/1782599/4888994.aspx/1?Paging+Through+a+ListViewPaging Through a ListView <p>Hey,</p> <p>I'm currently pulling groups of 6 rows from my database with my DataPager looking like this:</p> <pre class="prettyprint">&lt;asp:DataPager ID=&quot;DataPager1&quot; runat=&quot;server&quot; PageSize=&quot;4&quot;&gt; &lt;Fields&gt; &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowFirstPageButton=&quot;True&quot; ShowNextPageButton=&quot;False&quot; ShowPreviousPageButton=&quot;False&quot; /&gt; &lt;asp:NumericPagerField /&gt; &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowLastPageButton=&quot;True&quot; ShowNextPageButton=&quot;True&quot; ShowPreviousPageButton=&quot;True&quot; /&gt; &lt;/Fields&gt; &lt;/asp:DataPager&gt;</pre> <p>When on the first page, it is the front page of my website http://www.darvinkmanwah.com but then when it goes to page 2 of the data the URL does not change. How can I code it where when on page 2 the URL changes to reflect page 2 and so on.</p> 2012-03-20T08:48:54-04:002012-03-20T08:48:54.573-04:00urn:uuid:00000000-0000-0000-0000-000005392437http://forums.asp.net/p/1905669/5392437.aspx/1?All+validation+attribute+works+fine+requierd+Range+and+other+but+the+other+does+not+works+Display+and+ScaffoldColumn+All validation attribute works fine[requierd -Range and other] but the other does not works [ Display and ScaffoldColumn] <p>i have&nbsp;Test_DB.edmx file contains 1 table called Tbl_Users</p> <p>i created partial class to apply my validation and Handel some properties Attribute &nbsp;like Display and&nbsp;ScaffoldColumn</p> <p></p> <p>my problem is :</p> <p>All validation attribute works fine[requierd -Range and other]</p> <p>but the other does not works [&nbsp;Display and&nbsp;ScaffoldColumn]</p> <p>is that any Suggestions&nbsp;</p> <p>My code is:</p> <pre class="prettyprint">[MetadataType(typeof(CUsers))] public partial class Tbl_Users { } public partial class CUsers { #region Primitive Properties public int UserID { get; set; } [Required()] [Display(Name = &quot;UserName&quot;, ResourceType = typeof(Resources.App_Resource))] public String UserName { get; set; } [Required()] [Display(Name = &quot;Password&quot;, ResourceType = typeof(Resources.App_Resource))] [ScaffoldColumn(false)] public String Password { get; set; } [Required()] [Display(Name = &quot;DOB&quot;, ResourceType = typeof(Resources.App_Resource))] public DateTime DOB { get; set; } #endregion }</pre> <p><br> <br> </p> <p></p> 2013-05-13T13:36:21-04:002013-05-13T13:36:21.52-04:00urn:uuid:00000000-0000-0000-0000-000005392069http://forums.asp.net/p/1905578/5392069.aspx/1?Customising+data+annotations+in+dynamic+dataCustomising data annotations in dynamic data <p>&nbsp;have come across a scenerio that to customize DataAnnotations in Dynamic Data Web Application. This is the scenerio:</p> <p><strong>[Display(Name=&quot;DispName&quot;)]</strong></p> <p><strong>public string DName{get;set;}</strong></p> <p>Instead of hardcoding Name=&quot;DispName&quot; for Display DataAnnotation, I want to fetch some value from DataBase and fit int the Name attribute. like:</p> <p><strong>[Display(Name=SomeValueFromDB)]</strong></p> <p><strong>public string DName{get;set;}</strong></p> <p>Is there any way to show the Name attribute of Display DataAnnotation from database instead of hardcoding its value?</p> <p>Thanks in advance,</p> <p>Sujith</p> 2013-05-13T08:37:11-04:002013-05-13T08:37:11.96-04:00urn:uuid:00000000-0000-0000-0000-000005371876http://forums.asp.net/p/1900936/5371876.aspx/1?Custom+page+with+Dynamic+Data+and+Multiple+ComboBoxesCustom page with Dynamic Data and Multiple ComboBoxes <p>I want to create a custom&nbsp;ASP.Net C# dynamic data page. This page should work (ideally) like this:</p> <ol> <li>It will display a line (a row at a time) of a GridView containing four columns: a Label containig the text of one question, a ComboBox for choosing data, an empty TextBox and a command buttong for saving the data and passing to the next row </li><li>The ComboBox will be populated with data coming from an entity (a different entity for each row of the GridView) </li><li>After making selection in the ComboBox the selected text should be copied to the TextBox </li><li>Afte r saving the data from that row the gridView will display the next row containing the same elements like the firts one BUT populating the ComboBox with values coming from a 2nd entity and so on for every new row </li></ol> <p>Process will end when all entities pertaining to this process (which will be defined somehow in the code behind of the page) have been used</p> <p>Then the text contained in all TextBoxes will be concatenated in a single string</p> <p></p> <p>Best regards</p> <p></p> <p>Carlos N. Porras<br> (El Salvador)&nbsp;</p> 2013-04-22T23:00:39-04:002013-04-22T23:00:39.253-04:00urn:uuid:00000000-0000-0000-0000-000005391433http://forums.asp.net/p/1905429/5391433.aspx/1?how+to+update+the+domainservice+cs+file+with+a+new+tablehow to update the domainservice.cs file with a new table <p>Users are the most unpredictable species. I am required to add a new table to the project. I have done alot of modifications to the domainservice file is there any way to update the domainservice file?</p> 2013-05-12T09:01:08-04:002013-05-12T09:01:08.17-04:00urn:uuid:00000000-0000-0000-0000-000004133027http://forums.asp.net/p/1614916/4133027.aspx/1?Dynamic+Data+using+Code+First+Entity+Framework+ModelDynamic Data using Code First Entity Framework Model <p>I have used Dynamic Data before using LinqToEntity where my Entity model used the Data First model and the GUI.&nbsp; Now I am trying to use the Code First model witht he Entity CTP 4.&nbsp; I have my model created and created a new Dynamic Data site.&nbsp; I read that I need to replace the default RegisterContext call:</p> <pre style="font-family:consolas">DefaultModel.RegisterContext(<span style="color:blue">typeof</span>(<span style="color:#2b91af">PriceLoaderContext</span>),&nbsp;<span style="color:blue">new</span>&nbsp;<span style="color:#2b91af">ContextConfiguration</span>()&nbsp;{&nbsp;ScaffoldAllTables&nbsp;=&nbsp;<span style="color:blue">true</span>&nbsp;});<br></pre> <p>with</p> <pre style="font-family:consolas">DefaultModel.RegisterContext(<span style="color:blue">new</span>&nbsp;<span style="color:red">DomainModelProvider</span>(<span style="color:blue">typeof</span>(<span style="color:#2b91af">PriceLoaderContext</span>)),&nbsp;<span style="color:blue">new</span>&nbsp;<span style="color:#2b91af">ContextConfiguration</span>()&nbsp;{&nbsp;ScaffoldAllTables&nbsp;=&nbsp;<span style="color:blue">true</span>&nbsp;});&nbsp;<br></pre> <p>When I search further on DomainModelProvider, I find that it is part of the WCF RIA. Is this correct? Is this what I need for this to work? Has anyone else done this and got it to work?<br> <br> <br> Thanks,<br> Fred Gohsman</p> 2010-10-20T13:09:58-04:002010-10-20T13:09:58.4-04:00urn:uuid:00000000-0000-0000-0000-000005386328http://forums.asp.net/p/1904253/5386328.aspx/1?How+to+set+MaxLength+of+a+textbox+asp+net+dynamic+dataHow to set MaxLength of a textbox asp.net dynamic data <p>Hi All,</p> <p>I have the following dynamic control.</p> <p>&lt;asp:DynamicControl ID=&quot;DynamicControl1&quot; runat=&quot;server&quot; DataField=&quot;Label&quot; UIHint=&quot;Text_Edit&quot; /&gt;</p> <p>The maxlength for this is was intially set to 255 in database as well as in .edmx file.</p> <p>&lt;Property Name=&quot;Label&quot; Type=&quot;nvarchar&quot; Nullable=&quot;false&quot; MaxLength=&quot;255&quot; /&gt;(.edmx file).</p> <p>So the Label textbox was allowing me to enter only 255 characters. When I tried entering more than 255 characters it was cut off.(which is perfect).</p> <p>Now, I want to increase the MaxLength of the 'Label' text box to 555. I changed the column length in database to 555. Also the edmx file has&nbsp; label MaxLength set to 555.</p> <p>&lt;Property Name=&quot;Label&quot; Type=&quot;nvarchar&quot; Nullable=&quot;false&quot; MaxLength=&quot;555&quot; /&gt;(.edmx file).</p> <p>But it still allows only 255 characters. How can I increase this? I am missing something obvious? Please help.</p> <p>Thanks,</p> <p>sreethi</p> 2013-05-07T04:01:36-04:002013-05-07T04:01:36.977-04:00urn:uuid:00000000-0000-0000-0000-000004488894http://forums.asp.net/p/1696112/4488894.aspx/1?Display+link+to+show+related+data+Many+to+Many+Field+Template+Display link to show related data (Many to Many Field Template) <p>Hello,&nbsp;</p> <p></p> <p>By default the Many to Many Field Template is displaying a link for each related row. But in my case this looks very confusing because there are too many links shown. So is it possible to display one single link instead? For example if there is a products table there would be a link &quot;Show orders&quot; for each product redirecting to a filtered order table.&nbsp;</p> <p></p> <p>Thanks for your help.</p> 2011-07-02T19:52:36-04:002011-07-02T19:52:36.317-04:00urn:uuid:00000000-0000-0000-0000-000005388082http://forums.asp.net/p/1904665/5388082.aspx/1?Is+it+possible+to+add+a+new+table+to+an+existing+Dynamic+Data+project+Is it possible to add a new table to an existing Dynamic Data project? <p>If so how?</p> <p>Any advice will be appreciated.</p> 2013-05-08T12:31:09-04:002013-05-08T12:31:09.283-04:00urn:uuid:00000000-0000-0000-0000-000005377377http://forums.asp.net/p/1902208/5377377.aspx/1?VS2010+Context+type+in+EF+dynamic+dataVS2010 - Context type in EF dynamic data <p>Hi,<br> &nbsp;&nbsp; I am trying to build a Dynamic Data website with Entity Framework since I have oracle as a back-end database.<br> I am using Oracle provided ODAC (ODP.NET) as data provider.<br> <br> Question: What Context should I place in the &quot;YourDataContextType&quot; Global.asax file.<br> <br> I have used default values for Model Namespace (Model) and entity connection Settings (Entities).<br> If I replace &quot;YourDataContextType&quot; with &quot;Model&quot; I receive the error &quot;Model is a namespace but is used like a type&quot;.<br> If I replace &quot;YourDataContextType&quot; with &quot;Entities&quot; I receive the error &quot;The type or namespace Entities could not be found&quot;<br> <br> I am using VS 2010 Prof. version, oracle 11g.<br> Listed below are snippets of Global.asx and Model.Designer.cs file.</p> <pre class="prettyprint">File = Model.Designer.cs ======================== using System; using System.Data.Objects; using System.Data.Objects.DataClasses; using System.Data.EntityClient; using System.ComponentModel; using System.Xml.Serialization; using System.Runtime.Serialization; [assembly: EdmSchemaAttribute()] #region EDM Relationship Metadata [assembly: EdmRelationshipAttribute(&quot;Model&quot;, &quot;ORDERS_CUSTOMER_ID_FK&quot;, &quot;CUSTOMERS&quot;, System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Model.CUSTOMER), &quot;ORDERS&quot;, System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Model.ORDER), true)] [assembly: EdmRelationshipAttribute(&quot;Model&quot;, &quot;ORDER_ITEMS_ORDER_ID_FK&quot;, &quot;ORDERS&quot;, System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Model.ORDER), &quot;ORDER_ITEMS&quot;, System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Model.ORDER_ITEMS), true)] [assembly: EdmRelationshipAttribute(&quot;Model&quot;, &quot;ORDER_ITEMS_PRODUCT_ID_FK&quot;, &quot;PRODUCT_INFORMATION&quot;, System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Model.PRODUCT_INFORMATION), &quot;ORDER_ITEMS&quot;, System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Model.ORDER_ITEMS), true)] #endregion namespace Model { #region Contexts /// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; public partial class Entities : ObjectContext { #region Constructors /// &lt;summary&gt; /// Initializes a new Entities object using the connection string found in the 'Entities' section of the application configuration file. /// &lt;/summary&gt; public Entities() : base(&quot;name=Entities&quot;, &quot;Entities&quot;) { this.ContextOptions.LazyLoadingEnabled = true; OnContextCreated(); } file = Global.asax ================== &lt;%@ Application Language=&quot;C#&quot; %&gt; &lt;%@ Import Namespace=&quot;System.ComponentModel.DataAnnotations&quot; %&gt; &lt;%@ Import Namespace=&quot;System.Web.Routing&quot; %&gt; &lt;%@ Import Namespace=&quot;System.Web.DynamicData&quot; %&gt; &lt;script RunAt=&quot;server&quot;&gt; private static MetaModel s_defaultModel = new MetaModel(); public static MetaModel DefaultModel { get { return s_defaultModel; } } public static void RegisterRoutes(RouteCollection routes) { //DefaultModel.RegisterContext(typeof(YourDataContextType), new ContextConfiguration() { ScaffoldAllTables = false });</pre> <p><br> <br> </p> 2013-04-28T05:29:05-04:002013-04-28T05:29:05.793-04:00urn:uuid:00000000-0000-0000-0000-000005381158http://forums.asp.net/p/1903054/5381158.aspx/1?Insert+Update+Delete+Multiple+tableInsert/Update/Delete - Multiple table <p>Hi,</p> <p>I am using ASP.NET Dynamic data. I have an existing data model (*.edmx) created as part of the dynamic data. I have to add another entity which would show data from multiple tables. Example</p> <p>Entity view - EmployeeDetails:</p> <ul> <li>EmployeeID </li><li>EmployeeName </li><li>Desigination </li><li>Department </li><li>AddressLine1 </li><li>AddressLine2 </li></ul> <p>This gets data all the data from Employee Table and one 2 columns from AddressDetails table.</p> <p>Employee-Table:</p> <ul> <li>EmployeeID </li><li>EmployeeName </li><li>Desigination </li><li>Department </li></ul> <p>AddressDetails –Table</p> <ul> <li>EmployeeID </li><li>EmployeeName </li><li>AddressLine1 </li><li>AddressLine2 </li><li>City –allows null </li><li>PostCode –allows null </li></ul> <p>I want to create a EmployeeDetails entity in a single page and let the user to insert/update/delete. How can I achieve it. If I create a view for the EmployeeDetails, I’ll not be able to do insert/update/delete. How can I do..</p> <p>I am a beginner, so please provide step-by-step guidance.</p> <p>Thanks in advance&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> 2013-05-01T16:52:14-04:002013-05-01T16:52:14.967-04:00urn:uuid:00000000-0000-0000-0000-000005378400http://forums.asp.net/p/1902472/5378400.aspx/1?How+do+I+write+the+predicate+to+test+for+more+than+one+value+How do I write the predicate to test for more than one value? <p>I have:&nbsp;</p> <pre class="prettyprint">return this.ObjectContext.StudentGrades.Include(&quot;Student&quot;).Include(&quot;Subject&quot;).Where(s =&gt; s.StudentID == intStudentID()).OrderBy(s =&gt; s.ID);</pre> <p>Which returns one student. However a parent has access to the StudentGrades and may have one or more students enrolled. I can write an SQL query to get the data I want but I do not know how to apply it to the Where clause.&nbsp;</p> <p>Please help.</p> 2013-04-29T11:31:41-04:002013-04-29T11:31:41.417-04:00urn:uuid:00000000-0000-0000-0000-000005142804http://forums.asp.net/p/1842714/5142804.aspx/1?VS2012+RTM+Context+type+is+not+supported+with+ASP+NET+dynamic+dataVS2012 RTM - Context type is not supported with ASP.NET dynamic data <ul> <li>Creating a new ASP.NET dynamic date project with VS 2012 RTM. </li><li>Add new EF model </li><li>fix the&nbsp;RegisterContext line in Global.asx </li></ul> <p>run debug and get the error.</p> <p>I beleive Microsoft didn't debug well prior to release with Dynamic data..............</p> <p></p> 2012-09-12T14:17:20-04:002012-09-12T14:17:20.71-04:00urn:uuid:00000000-0000-0000-0000-000005375273http://forums.asp.net/p/1901702/5375273.aspx/1?Visibility+of+DynamicFieldVisibility of DynamicField <p>I am having a heck of a time discovering how to manipulate the visible attribute of the DynamicField object within a DetailsView. I use the declarative attribute &quot;Visible&quot;&nbsp;to hide the field and of course when the page is displayed the entire detail row is not visible as I was hoping. What I need is to manipulate&nbsp;the detail row visibility with&nbsp;code-behind for the page. I will also use code-behind in a field template to manipulate the same. What I am considering is abandoning the declarative approach and use code-behind exclusively&nbsp;to set visibility of the rows, but if I understood where to access the&nbsp;correct visibile property with code-behind, the declarative approach would be preferred I think. Is it possible to access the same visible attribute using the syntax DetailsView1.FindFieldTemplate(&quot;myFld&quot;) and navigating the control hierarchy?</p> <p>Custom Page Markup:</p> <pre class="prettyprint">... &lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot;&gt; &lt;ContentTemplate&gt; &lt;asp:DetailsView ID=&quot;DetailsView1&quot; runat=&quot;server&quot; DataSourceID=&quot;DetailsDataSource&quot; DefaultMode=&quot;Insert&quot; AutoGenerateInsertButton=&quot;False&quot; CssClass=&quot;detailstable&quot; FieldHeaderStyle-CssClass=&quot;bold&quot; AutoGenerateRows=&quot;false&quot;&gt; &lt;Fields&gt; &lt;asp:DynamicField DataField=&quot;myFld&quot; Visible=&quot;false&quot; UIHint=&quot;myFldTemplate&quot; /&gt; &lt;/Fields&gt; &lt;/asp:DetailsView&gt; ... &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt;</pre> <p><strong>&nbsp;Update:</strong></p> <p>I investigated abandoning the declarative approach entirely relying only on code-behind to manipulate visibility. This was successful, but I am still curious about the declarative approach and how to access this attribute from code-behind. The code to manipulate the detail row visibility uses DetailsView1.FindFieldTemplate(&quot;myFld&quot;) and traverses control parents to find the DetailsViewRow. The code manipulates the visibility of the detail row from the Load event of the page and also the OnTextChanged event of another control on the same page.</p> 2013-04-25T16:44:18-04:002013-04-25T16:44:18.86-04:00urn:uuid:00000000-0000-0000-0000-000005374431http://forums.asp.net/p/1901519/5374431.aspx/1?textbox+column+to+drop+downtextbox column to drop down <p>I have a column 'Indicator' which stores either 'P' or 'D'. I dont want to show a textbox while editing instead a drop down is required.</p> <p>I know like creating a new table with 'P' &amp; 'D' records and providing a foreign key relationship will display a drop down. But is there any other way without creating a table ? something i can do in the code itself ?</p> <p>Rakesh</p> 2013-04-25T05:32:23-04:002013-04-25T05:32:23.607-04:00