More in this section

Forums / Developing with Sitefinity / RadGrid Insert Text

RadGrid Insert Text

3 posts, 0 answered
  1. John S.
    John S. avatar
    126 posts
    Registered:
    09 Aug 2004
    17 Oct 2011
    Link to this post
    Hello,

    I have a very simple user control that has a RadGrid in it. All works correctly (Automatic Add/Edit/Delete) except when I click the Add Record button the link buttons text say Edit | Cancel instead of Insert | Cancel.

    What am I missing here?

    Thaks,
    John S.
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    17 Oct 2011
    Link to this post
    Can you post the code?  Using an Edit FormTemplate?
  3. John S.
    John S. avatar
    126 posts
    Registered:
    09 Aug 2004
    17 Oct 2011
    Link to this post
    Steve,

    I am unsure how to use a Form Template to post this but it is a pretty straight forward control with no code behind.


    <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ucPropertyTypes.ascx.vb" Inherits="SitefinityVb.ucPropertyTypes" %>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" 
        height="400px" HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1" 
        width="900px">
        <telerik:RadGrid ID="RadGrid1" runat="server" 
        CellSpacing="0" DataSourceID="sdsPropertyTypes" GridLines="None" 
            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowSorting="True" 
            AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" 
            AllowAutomaticDeletes="True" >
            <MasterTableView DataKeyNames="ID" 
            DataSourceID="sdsPropertyTypes" CommandItemDisplay="Top">
                <CommandItemSettings ExportToPdfText="Export to PDF">
                </CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" 
                FilterControlAltText="Filter ID column" HeaderText="ID" ReadOnly="True" 
                SortExpression="ID" UniqueName="ID" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DESCRIPTION" 
                FilterControlAltText="Filter DESCRIPTION column" HeaderText="DESCRIPTION" 
                SortExpression="DESCRIPTION" UniqueName="DESCRIPTION">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="ACTIVE" DataType="System.Boolean" 
                FilterControlAltText="Filter ACTIVE column" HeaderText="Active" 
                SortExpression="ACTIVE" UniqueName="ACTIVE" DefaultInsertValue="True">
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column">
                        <HeaderStyle Width="50px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridEditCommandColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="sdsPropertyTypes" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SiteConnectionString %>" 
        DeleteCommand="DELETE FROM [PROPERTY_TYPES] WHERE [ID] = @ID" 
        InsertCommand="INSERT INTO [PROPERTY_TYPES] ([DESCRIPTION], [ACTIVE]) VALUES (@DESCRIPTION, @ACTIVE)" 
        SelectCommand="SELECT [ID], [DESCRIPTION], [ACTIVE] FROM [PROPERTY_TYPES] ORDER BY [DESCRIPTION]" 
          
            UpdateCommand="UPDATE [PROPERTY_TYPES] SET [DESCRIPTION] = @DESCRIPTION, [ACTIVE] = @ACTIVE WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="DESCRIPTION" Type="String" />
                <asp:Parameter Name="ACTIVE" Type="Boolean" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="DESCRIPTION" Type="String" />
                <asp:Parameter Name="ACTIVE" Type="Boolean" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" 
        Skin="Default">
    </telerik:RadAjaxLoadingPanel>
3 posts, 0 answered