Open grid for insert on page load default values.

2 posts, 0 answers
  1. Ted
    Ted avatar
    47 posts
    Member since:
    Jan 2008

    Posted 28 Apr 2010 Link to this post

    I am using a grid in my page for the user to insert data into.  on opening the page I want the grid to open the insert mode.  I put this in and it works but the default values are not showing in the fields.  if I just load the page and click on the insert link the values are there.  is there a way I can get my default values to show while opening this on the page load?




    void RadGrid2_PreRender(object sender, EventArgs e)




    if (!Page.IsPostBack)



    RadGrid2.MasterTableView.IsItemInserted =






    my column editor looks like this



    telerik:GridNumericColumnEditor ID="CCTavelCostColumnEditor" runat="server">



    <NumericTextBox runat="server" ID="NumericTextBox3" Width="80px" Value="0" NumberFormat-DecimalDigits="0" Type="Currency"







    if it helps my column is like this




    telerik:GridNumericColumn Aggregate="Sum" DataField="TRAVELCOST" HeaderText="TRAVEL COST" UniqueName="TRAVELCOST" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"



    DataType="System.Decimal" DataFormatString="{0:C}" ColumnEditorID="CCTavelCostColumnEditor" ItemStyle-Width="80px"






    FooterAggregateFormatString="{0:C}" FooterStyle-HorizontalAlign="Right">






    <FooterStyle HorizontalAlign="Right"></FooterStyle>






    <HeaderStyle HorizontalAlign="Right"></HeaderStyle>






    <ItemStyle HorizontalAlign="Right"></ItemStyle>






    </telerik:GridNumericColumn >


  2. Pavlina
    Pavlina avatar
    6161 posts

    Posted 30 Apr 2010 Link to this post

    Hello Ted,

    I am not quite sure if I understand your scenario correctly. It is expected the fields to be empty when you put the grid in insert mode. Please note that when the grid is in insert mode it is expected to insert new row instead of changing the default one.
    In case you want to force the grid items in edit mode when the grid displays initially on the page, please refer to the help article below:
    Default edit mode for grid items on initial load

    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.
Back to Top