This is a migrated thread and some comments may be shown as answers.

Bar for Add Record and Refresh

2 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marion
Top achievements
Rank 1
Marion asked on 02 Sep 2011, 04:47 PM
I'm not able to find the Add Record bar for any RadGrids that I create. I can Edit and Delete but don't see the usual bar (bar that I see in the Telerik RadGrid demos). Is there a check box that I'm missing? The code for my currrent Grid is below.

<form id="form1" runat="server">
    <p>
        <br />
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </p>
    <div>
    
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" 
            AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0" 
            DataSourceID="dsRadGrid" GridLines="None" AllowAutomaticInserts="True" 
            ShowFooter="True" Skin="Office2007">
<MasterTableView autogeneratecolumns="False" datakeynames="photoID" 
                datasourceid="dsRadGrid">
<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="photoID" DataType="System.Int16" 
            FilterControlAltText="Filter photoID column" HeaderText="ID" ReadOnly="True" 
            SortExpression="photoID" UniqueName="photoID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="photoFilename" 
            FilterControlAltText="Filter photoFilename column" HeaderText="Filename" 
            SortExpression="photoFilename" UniqueName="photoFilename">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="photoTags" 
            FilterControlAltText="Filter photoTags column" HeaderText="Tags" 
            SortExpression="photoTags" UniqueName="photoTags">
        </telerik:GridBoundColumn>
        <telerik:GridImageColumn DataImageUrlFields="photoFilename" DataImageUrlFormatString="http://fshn.ifas.ufl.edu/photos/images/thumbnails/{0}"
            FilterControlAltText="Filter column column" HeaderText="Photo" ImageHeight="" 
            ImageWidth="" 
            UniqueName="column">
        </telerik:GridImageColumn>
    </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="dsRadGrid" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FSHN_ImagesConnectionString %>" 
            DeleteCommand="DELETE FROM [department_photos] WHERE [photoID] = @photoID" 
            InsertCommand="INSERT INTO [department_photos] ([photoFilename], [photoTags]) VALUES (@photoFilename, @photoTags)" 
            SelectCommand="SELECT * FROM [department_photos] ORDER BY [photoID]" 
            UpdateCommand="UPDATE [department_photos] SET [photoFilename] = @photoFilename, [photoTags] = @photoTags WHERE [photoID] = @photoID">
            <DeleteParameters>
                <asp:Parameter Name="photoID" Type="Int16" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="photoFilename" Type="String" />
                <asp:Parameter Name="photoTags" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="photoFilename" Type="String" />
                <asp:Parameter Name="photoTags" Type="String" />
                <asp:Parameter Name="photoID" Type="Int16" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>

thanks for any help.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Sep 2011, 04:52 PM
Hello Marion,

Try setting the CommandItemDisplay.
aspx:
<MasterTableView CommandItemDisplay="Top" >


Thanks,
Princy.
0
Marion
Top achievements
Rank 1
answered on 02 Sep 2011, 04:59 PM
Thanks, Princy. Worked like a charm. I'm a little puzzled though if that is the only way to set it. Makes me wonder why it's not also a check off option like Sorting, Paging, etc. Thanks for your time.
Tags
Grid
Asked by
Marion
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Marion
Top achievements
Rank 1
Share this question
or