locked
Customiez view details RRS feed

  • Question

  • User-1759624489 posted

     Hello. I created a custom page for a table called City., but that table has associated Branchs.

     

    I want to create column with a custom Text that says in spanish. View Cities.

     

    What should I do?

     

    I have something like

     

        <Columns>
                                    <asp:DynamicField DataField="Id" />
                                    <asp:DynamicField DataField="Name" HeaderText="Nombre de La ciudad" />
                                    <asp:CommandField ButtonType="Image" CancelText="Cancelar"
                                        DeleteImageUrl="~/App_Themes/Theme1/ImageLibrary/icoDelete.png"
                                        DeleteText="Eliminar"
                                        EditImageUrl="~/App_Themes/Theme1/ImageLibrary/icoEdit.png" EditText="Editar"
                                        InsertText="Insertar" NewText="Nuevo" SelectText="Seleccionar"
                                        ShowDeleteButton="True" ShowEditButton="True" UpdateText="Actualizar" />
                                    <%--                    <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HyperLink ID="EditHyperLink" runat="server"
                                    NavigateUrl='<%# table.GetActionPath(PageAction.Edit, GetDataItem()) %>'
                                Text="Edit" />&nbsp;<asp:LinkButton ID="DeleteLinkButton" runat="server" CommandName="Delete"
                                    CausesValidation="false" Text="Delete"
                                    OnClientClick='return confirm("Are you sure you want to delete this item?");'
                                />&nbsp;<asp:HyperLink ID="DetailsHyperLink" runat="server"
                                    NavigateUrl='<%# table.GetActionPath(PageAction.Details, GetDataItem()) %>'
                                    Text="Details" />
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                                </Columns>

    Friday, August 29, 2008 10:42 AM

Answers

  • User-797310475 posted

    If the associations between these tables are present in your model then you should get this automatically in the default page templates. If you are using custom pages with your own column set then you just need to add a DynamicControl (or DynamicField) that has the name of your strongly-typed relationship column in the DataField property. To customize what gets rendered (like the text of the link) you should edit the Childre.ascx user control located in ~\DynamicData\FieldTemplates\

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 29, 2008 3:20 PM

All replies

  • User-1759624489 posted

    I wrote this. but the page doesnt do anything when the hyperlink is clicked.

     

        <asp:TemplateField ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False"
                                                CommandName="Delete"   OnClientClick='return confirm("Esta seguro que quiere eliminar este registro?");'
                                                ImageUrl="~/App_Themes/SodexoTheme/ImageLibrary/icoDelete.png" Text="Delete" />
                                       <asp:HyperLink ID="DetailsHyperLink" runat="server"
                                    NavigateUrl='<%# table.GetActionPath(PageAction.Details, GetDataItem()) %>'
                                    Text="Ver Ciudades" />
                                        </ItemTemplate>
                                        

    Friday, August 29, 2008 12:52 PM
  • User-797310475 posted

    Hi, could you clarify what you are trying to do? Which page are you trying to add this link to (City or Branch) and what is the intended behavior (do you want to view all cities or just one)?

    Friday, August 29, 2008 1:58 PM
  • User-1759624489 posted

     Ok. Here we go

     

     Regional have cities, Cities have branches.

     I want in the regional table, a link that says View Cities, in spanish of course

     

    And in the Cities table, I want a link that says View Branches.

     

    Thx

    Friday, August 29, 2008 2:55 PM
  • User-1759624489 posted

    Friday, August 29, 2008 2:57 PM
  • User-797310475 posted

    If the associations between these tables are present in your model then you should get this automatically in the default page templates. If you are using custom pages with your own column set then you just need to add a DynamicControl (or DynamicField) that has the name of your strongly-typed relationship column in the DataField property. To customize what gets rendered (like the text of the link) you should edit the Childre.ascx user control located in ~\DynamicData\FieldTemplates\

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 29, 2008 3:20 PM
  • User-1759624489 posted

     This is awesome. Thank you very much.

     


     

    Friday, August 29, 2008 3:36 PM