locked
Can you have conditional FieldTemplate Assignments ? RRS feed

  • Question

  • User1682745178 posted

    Is it possible to place a conditional-type statement on the UIHint (or perhaps the entire DynamicField statement)....?  For a given field (like EmployeeMaster), I'd like to use "ForeignKey_ReadOnly" in some instances and "ForeignKey_Filter" in others...

     Thanks...!

    <Columns>

    <asp:DynamicField DataField="Company" UIHint="ForeignKey_ReadOnly" HeaderText="Company" />

    <asp:DynamicField DataField="PayrollPeriod" UIHint="ForeignKey_ReadOnly" HeaderText="PR Period" />

    <asp:DynamicField DataField="Date" HeaderText="Date" />

    <asp:DynamicField DataField="EmployeeMaster" UIHint="ForeignKey_Filter" HeaderText="Clock Number" />

    <asp:DynamicReadOnlyField DataField="LineSeq" HeaderText="Line Seq" />

    <asp:DynamicReadOnlyField DataField="RecType" HeaderText="Rec Type" />

    <asp:DynamicField DataField="PayCode" UIHint="ForeignKey_Filter" HeaderText="Pay Code" />

    <asp:DynamicField DataField="PositionCode" UIHint="ForeignKey_Filter" HeaderText="Position Code" />

    <asp:DynamicField DataField="PayRate" HeaderText="Pay Rate" />

    <asp:DynamicField DataField="Hours" HeaderText="Hours" />

    <asp:DynamicField DataField="Earnings" HeaderText="Earnings" />

    </Columns>

    Friday, August 22, 2008 1:11 PM

Answers

  • User-330204900 posted

    No, but you can in DynmaicControl which means you would:

    <?xml:namespace prefix = asp /><asp:TemplateField class=st HeaderText="<asp:DynamicControl class=st runat="<asp:DynamicControl class=st runat=" 
    <asp:TemplateField HeaderText="ProductID" InsertVisible="False" SortExpression="ProductID">
    	<EditItemTemplate>
    		<asp:DynamicControl runat="server" Mode="Edit" DataField="ProductID" UIHint="Enumeration" />
    	</EditItemTemplate>
    	<ItemTemplate>
    		<asp:DynamicControl runat="server" Mode="ReadOnly" DataField="ProductID" UIHint="Text" />
    	</ItemTemplate>
    </asp:TemplateField>
     </asp:TemplateField>
     </asp:DynamicControl></asp:DynamicControl>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 22, 2008 2:39 PM

All replies

  • User-330204900 posted

    No, but you can in DynmaicControl which means you would:

    <?xml:namespace prefix = asp /><asp:TemplateField class=st HeaderText="<asp:DynamicControl class=st runat="<asp:DynamicControl class=st runat=" 
    <asp:TemplateField HeaderText="ProductID" InsertVisible="False" SortExpression="ProductID">
    	<EditItemTemplate>
    		<asp:DynamicControl runat="server" Mode="Edit" DataField="ProductID" UIHint="Enumeration" />
    	</EditItemTemplate>
    	<ItemTemplate>
    		<asp:DynamicControl runat="server" Mode="ReadOnly" DataField="ProductID" UIHint="Text" />
    	</ItemTemplate>
    </asp:TemplateField>
     </asp:TemplateField>
     </asp:DynamicControl></asp:DynamicControl>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 22, 2008 2:39 PM
  • User1682745178 posted

    Thanks, Steve...!  I need to do a little more research (to understand what drives the "mode"), but it looks like exactly what I need.

    I really appreciate it... 

     

    Friday, August 22, 2008 3:09 PM