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

[Solved] RadGrid, on "add new record" the table become too big

4 Answers 242 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Felice
Top achievements
Rank 1
Felice asked on 25 Aug 2013, 03:21 PM
I have a RadGrid with "add new record" features. The table fits perfectly in the window but when I click on "Add new record", it opens up and became too big for the window. How can I keep the table within the same dimensions after clicking on "add new record"?

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Aug 2013, 04:56 AM
Hi felice,

This is not an expected behaviour. Can you make sure you havn't set any height or width for the edit form,if so, the form width/height shouldn't be greater than the radgrid's width/height.Here is a sample code snippet please give a try,i have attached the screenshot of my output screen.If this doesn't help,please provide your full code snippet.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowPaging="true">
    <MasterTableView DataKeyNames="OrderID" CommandItemDisplay="Top">
        <Columns>
            <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID" HeaderText="OrderID" />
            <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" UniqueName="ShipCity" />
            <telerik:GridBoundColumn DataField="ShipName" HeaderText="ShipName" UniqueName="ShipName" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Thanks,
Princy
0
Felice
Top achievements
Rank 1
answered on 26 Aug 2013, 05:20 AM
Hi Princy,
thanks a lot for your help. I am not winning, when I click on "insert", the form open up too big for the page. Here is the snipet. Also I am not able to make appearing the "edit" and "cancel" buttons. I have tried all I could out of my mind.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Customers.aspx.cs" Inherits="Customers" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WebTestData2ConnectionString1 %>" DeleteCommand="DELETE FROM [Customers] WHERE [CustomerName] = @CustomerName" InsertCommand="INSERT INTO [Customers] ([CustomerName], [CustomerContact], [Country], [date]) VALUES (@CustomerName, @CustomerContact, @Country, @date)" SelectCommand="SELECT [CustomerID], [CustomerName], [CustomerContact], [Country], [date] FROM [Customers]" UpdateCommand="UPDATE [Customers] SET [CustomerID] = @CustomerID, [CustomerContact] = @CustomerContact, [Country] = @Country, [date] = @date WHERE [CustomerName] = @CustomerName">
        <DeleteParameters>
            <asp:Parameter Name="CustomerName" Type="String" />
             <asp:Parameter Name="CustomerContact" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter DbType="Date" Name="date" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="CustomerName" Type="String" />
            <asp:Parameter Name="CustomerContact" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter DbType="Date" Name="date" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="CustomerContact" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter DbType="Date" Name="date" />
            <asp:Parameter Name="CustomerName" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <p>
        <br />
    </p>
     
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" CellSpacing="0" Culture="it-IT" DataSourceID="SqlDataSource1" GridLines="None" style="margin-right: 469px" Width="921px" AllowPaging="True" ShowFooter="True">
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="TopAndBottom" DataKeyNames="CustomerName,CustomerID" DataSourceID="SqlDataSource1" AllowSorting="True" ShowFooter="False">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="CustomerID" DataType="System.Int32" FilterControlAltText="Filter CustomerID column" HeaderText="CustomerID" ReadOnly="True" SortExpression="CustomerID" UniqueName="CustomerID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CustomerName" FilterControlAltText="Filter CustomerName column" HeaderText="CustomerName" SortExpression="CustomerName" UniqueName="CustomerName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CustomerContact" FilterControlAltText="Filter CustomerContact column" HeaderText="CustomerContact" SortExpression="CustomerContact" UniqueName="CustomerContact">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Country" FilterControlAltText="Filter Country column" HeaderText="Country" SortExpression="Country" UniqueName="Country">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="date" DataType="System.DateTime" FilterControlAltText="Filter date column" HeaderText="date" SortExpression="date" UniqueName="date">
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
    <PagerStyle AlwaysVisible="True" Mode="NextPrevNumericAndAdvanced" />
</MasterTableView>
 
        <PagerStyle AlwaysVisible="True" />
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="SqlDataSource1">
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="SqlDataSource1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
    </asp:Content>
0
Felice
Top achievements
Rank 1
answered on 26 Aug 2013, 07:50 AM
Ok, I managed to find the solution for the delete and edit. Still I cannot solve the dimensions problem.
0
Accepted
Princy
Top achievements
Rank 2
answered on 27 Aug 2013, 05:22 AM
Hi Felice,

Unfortunately,I couldn't replicate the issue.Your code works fine at my end.Can you try in all browsers and check if the issue exists.

Thanks,
Princy
Tags
Grid
Asked by
Felice
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Felice
Top achievements
Rank 1
Share this question
or