+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / GC Module ItemListView page

GC Module ItemListView page

2 posts, 0 answered
  1. Tarun
    Tarun avatar
    81 posts
    Registered:
    14 Jan 2009
    30 Sep 2010
    Link to this post
    Hi,

    I am working on GC module and want to add a button over ItemListView page in the grid which say sending mail.like below

    <telerik:ClientTemplate Name="Send Email" runat="server">
    <asp:Button ID="btnMail" runat="server" Text="Send Email" CommandName="Mail" CommandArgument="{#MetaFields.Email#}"    />
    </telerik:ClientTemplate>


    I will really appreciate if you guys can give me an example for how to bind metadata for the button and an event for sending mail.

    Thanks,
    Tarun

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Sep 2010
    Link to this post
    Hello Tarun,

    1. You have to add GridTemplateColumn with UniqueName that is the same as your metakey name.

    2. Inside DataBindGrid function of the template you have to add your metakey to requiredMetaFields array.

    You can use RadGrid_RowSelected which is fired OnRowSelected to get the selected row. Another option is getting the dataItem for the row on which your button resides. You can easily get the content item ID by using {#ID#} as a parameter of your custom function

    <telerik:ClientTemplatesHolder ID="GridTemplates" runat="server">
        <telerik:ClientTemplate ID="btnMail1" Name="btnMail1" runat="server">
                <a href="javascript:alert('{#ID#}')"><asp:Literal ID="Literal1" Text="send mail" runat="server" /></a>
        </telerik:ClientTemplate>


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered