Different form templates in EditFormSettings of rad grid

5 posts, 0 answers
  1. ankool
    ankool avatar
    50 posts
    Member since:
    Apr 2007

    Posted 18 Jun 2008 Link to this post

    Hi,

    Can we have different form template for different commands ?
    In my application i want different templates in case of  'Add New Record' and 'Edit'. Is it possible ?

    If yes, can you give an example of how to use it.


    Thanks
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 18 Jun 2008 Link to this post

    Hi Ankool,

    You can achieve this using UserControl edit form as shown in the following help article.
    Different edit forms on edit and insert

    Thanks
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ankool
    ankool avatar
    50 posts
    Member since:
    Apr 2007

    Posted 18 Jun 2008 Link to this post

    Thanks Shinu.


    Also, i would like to know that can i bind a text field of a column in detail table to a column value in parent Master Table.


    <

    MasterTableView AllowMultiColumnSorting="True" Width="100%" CommandItemDisplay="Top" DataKeyNames="ID">
    <DetailTables>
    <radG:GridTableView Width="80%" AutoGenerateColumns="false" HierarchyLoadMode="ServerBind"
    runat="server" CommandItemDisplay="Top" PageSize="3" Name="Roles" DataKeyNames="PartyID">
    <ParentTableRelation>
    <radG:GridRelationFields DetailKeyField="PartyID" MasterKeyField="ID" />
    </ParentTableRelation>
    <Columns>

    <radG:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">
    </radG:GridEditCommandColumn>

    <radG:GridBoundColumn SortExpression="PartyID" Visible="false" DataField="PartyID"UniqueName="PartyID">
    </radG:GridBoundColumn>

    <radG:GridBoundColumn SortExpression="PartyName" Visible="false" DataField="PartyName" UniqueName="PartyName">
    </radG:GridBoundColumn>

    <radG:GridBoundColumn SortExpression="Role" HeaderText="Role" DataField="Role" UniqueName="Role">
    </radG:GridBoundColumn>

    <radG:GridBoundColumn SortExpression="Component" HeaderText="Component" DataField="Component"UniqueName="Component">
    </radG:GridBoundColumn>

    <radG:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton"CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1"></radG:GridButtonColumn>

    </Columns>

    <EditFormSettings EditFormType="template">

    <FormTemplate>
    <asp:TextBox id="txtMasterTableColumnName" runat="server" Width="161px" CssClass="ContentFontReadOnly" Text='<%#Bind("Name") %>'></asp:TextBox>

    </FormTemplate>

    </EditFormSettings>

    <PagerStyle Mode="numericPages" PagerTextFormat="" />

    </radG:GridTableView>

    </DetailTables>
    <Columns>
    <radG:GridBoundColumn SortExpression="ID" Visible="false" DataField="ID" UniqueName="ID"></radG:GridBoundColumn>
    <radG:GridBoundColumn SortExpression="Name" HeaderText="Party Involved" DataField="Name" UniqueName="Name"></radG:GridBoundColumn>
    </Columns>
    </MasterTableView>


    Now, in above code, i require binding of a textbox in formatemplate of a detail table with a column in master table called "Name".

    Can this be achieved ?

  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Jun 2008 Link to this post

    Hi Ankool,

    You can achieve this if your are binding both the Master and detail table with the same DataSource.
    Update/Insert/Delete in hierarchy

    Princy.
  6. ankool
    ankool avatar
    50 posts
    Member since:
    Apr 2007

    Posted 18 Jun 2008 Link to this post

    Hi,

    Thanks but i am using a dataset ( created from a xml) to load both parent and child grid table views. So the only option to bind controls is by using <%#Bind("")%> syntax in controls value.

    So what to do in this case ?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017