AddNew record button and excel export

6 posts, 0 answers
  1. NVB
    NVB avatar
    39 posts
    Member since:
    Apr 2009

    Posted 13 Jul 2012 Link to this post

    Hi

    I am using commanditemtemplate in Radgrid to have   Add New Record,  Edit(This will put complete grid in Editmode) , Save and Cancel( This are visible in editmode only)  and excel button.  I defined them  all as  ASP buttons Specifically Save button I defined as <input type= "btn"  Visually they don't look good.

    I want to use default AddNewRecord image  displayed  by telerik in CommandItem.

    How to get those images to be used in commanitemtemplate.

    Also I want to show the Excel Icon (the oneTelerik uses bydefault) towards the Right on the command Item Display.

    Thanks

     .

  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 14 Jul 2012 Link to this post

    Hello,

    <CommandItemTemplate>
                        <table style="width: 100%; height: 20px;">
                            <tr>
                                <td align="left" style="width: 50%;">
                                    <input id="AddNewRecordButton" runat="server" class="rgAdd" type="button" title="Add new record"
                                        name="AddNewRecordButton">
                                </td>
                                <td align="right" style="width: 50%;">
                                  
                                    <input id="ExportToExcelButton" class="rgExpXLS" type="button" title="Export to Excel"
                                        name="ExportToExcelButton">
                                </td>
                            </tr>
                        </table>
                    </CommandItemTemplate>


    Thanks,
    Jayesh Goyani
  3. NVB
    NVB avatar
    39 posts
    Member since:
    Apr 2009

    Posted 16 Jul 2012 Link to this post

    Jayesh,

    Thanks for your suggestion. It is very helpfull.
    I will tryout on these lines.

    Thanks
  4. NVB
    NVB avatar
    39 posts
    Member since:
    Apr 2009

    Posted 19 Jul 2012 Link to this post

    Jayesh

    Thanks for the sugesstion.
    Is there anythign missing from the code  you suggested, becuase it does not do any postback.

    The icon displays correctly but withno associated text( next to  + icon)

    Any suggestions.

    Thanks


  5. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 20 Jul 2012 Link to this post

    Hello,

    <telerik:RadGrid ID="RadGrid3" runat="server" AutoGenerateColumns="false" OnNeedDataSource="RadGrid3_NeedDataSource"
               OnItemDataBound="RadGrid3_ItemDataBound" OnItemCommand="RadGrid3_ItemCommand">
               <MasterTableView DataKeyNames="ID" ClientDataKeyNames="ID" CommandItemDisplay="Top">
                   <CommandItemTemplate>
                       <table style="width: 100%; height: 20px;">
                           <tr>
                               <td align="left" style="width: 50%;">
                                   <asp:Button ID="AddNewRecordButton" runat="server" class="rgAdd" type="button" title="Add new record"
                                       name="AddNewRecordButton" CommandName="InitInsert" />
                                   <asp:LinkButton ID="Button3" runat="server" Text="Add new record" CommandName="InitInsert" />
                               </td>
                               <td align="right" style="width: 50%;">
                                   <asp:Button ID="ExportToExcelButton" runat="server" class="rgExpXLS" type="button"
                                       title="Export to Excel" name="ExportToExcelButton" CommandName="ExportToExcel" />
                               </td>
                           </tr>
                       </table>
                   </CommandItemTemplate>
                   <Columns>
                       <telerik:GridTemplateColumn>
                           <ItemTemplate>
                               <asp:CheckBox ID="Chk1" runat="server" />
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn>
                           <ItemTemplate>
                               <asp:CheckBox ID="Chk2" runat="server" />
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridBoundColumn HeaderText="ID" DataField="ID" UniqueName="ID">
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn HeaderText="Name" DataField="Name" UniqueName="Name">
                       </telerik:GridBoundColumn>
                   </Columns>
               </MasterTableView>
           </telerik:RadGrid>


    Thanks,
    Jayesh Goyani
  6. NVB
    NVB avatar
    39 posts
    Member since:
    Apr 2009

    Posted 21 Jul 2012 Link to this post

    Jayesh,

    Thanks very much . I apprecite you taking time to answer the questions.


    Thanks
Back to Top