GridNumericColumnEditor

6 posts, 1 answers
  1. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 26 Aug 2008 Link to this post

    Hello,
    I have a RadGrid that needs to have a editable text box for each row open and ready by default.
    What is better for a RadGrid with 100 -300 Rows, using a RadNumericTextBox or a GridNumericColumnEditor?
    See below:

    <telerik:GridTemplateColumn DataField="Price" HeaderText="Price" 
                SortExpression="Price" UniqueName="TemplateColumnPrice">
                <ItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPrice" runat="server" EmptyMessage="type ..." ShowSpinButtons="True" Type="Currency" width="200px" InvalidStyleDuration="100" Value='<%# Convert.ToDecimal(DataBinder.Eval(Container.DataItem, "Price")) %>'>
                        <NumberFormat AllowRounding="True" KeepNotRoundedValue="False" />
                    </telerik:RadNumericTextBox>
                    <asp:RequiredFieldValidator ID="rqPrice" ControlToValidate="txtPrice" runat="server" ErrorMessage="<%$ Resources:Backend, Required %>"/>
                </ItemTemplate>
            </telerik:GridTemplateColumn>

    Or using the: GridNumericColumnEditor

    <telerik:GridTemplateColumn DataField="Price" HeaderText="Price"
    SortExpression="Price" UniqueName="TemplateColumnPrice">
    <ItemTemplate>
    <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server">
    <NumericTextBox EmptyMessage="type ..." ShowSpinButtons="True" Type="Currency" width="200px" InvalidStyleDuration="100" Value='<%#Bind("Price") %>' ID="txtPrice">
    <NumberFormat AllowRounding="True" KeepNotRoundedValue="False" />
    </NumericTextBox>
    </telerik:GridNumericColumnEditor>
    </ItemTemplate>
    </telerik:GridTemplateColumn>

  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 27 Aug 2008 Link to this post

    Hello aron,

    Having a column editor will reduce the footprint of the page. However, please keep in mind that a column editor is used in a slightly different fashion, as demonstrated in the code snippet below:

    .aspx
     <telerik:RadGrid AllowMultiRowEdit="true" 
             ID="RadGrid1" runat="server" DataSourceID="AccessDataSource1" GridLines="None" OnPreRender="RadGrid1_PreRender">  
                <MasterTableView AutoGenerateColumns="False" DataSourceID="AccessDataSource1">  
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px" /> 
                    </ExpandCollapseColumn> 
                    <Columns> 
                      
                    <telerik:GridEditCommandColumn> 
                    </telerik:GridEditCommandColumn> 
                      
                        <telerik:GridBoundColumn DataField="ShipName" HeaderText="ShipName" SortExpression="ShipName" 
                            UniqueName="ShipName">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ShipAddress" HeaderText="ShipAddress" SortExpression="ShipAddress" 
                            UniqueName="ShipAddress">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" SortExpression="ShipCity" 
                            UniqueName="ShipCity">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" HeaderText="UnitPrice" 
                            SortExpression="UnitPrice" UniqueName="UnitPrice" ColumnEditorID="GridNumericColumnEditor1">  
                        </telerik:GridBoundColumn> 
                          
                         
                          
                    </Columns> 
                </MasterTableView> 
                <FilterMenu EnableTheming="True">  
                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                </FilterMenu> 
            </telerik:RadGrid><asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" 
                SelectCommand="SELECT TOp 100 [ShipName], [ShipAddress], [ShipCity], [UnitPrice] FROM [Invoices]">  
            </asp:AccessDataSource> 
              
              
          <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server">  
    <NumericTextBox runat="server" 
      ShowSpinButtons="True" Type="Currency" width="200px" InvalidStyleDuration="100" Value='<%#Eval("Price") %>' ID="txtPrice">  
    <NumberFormat AllowRounding="True" KeepNotRoundedValue="False" /> 
    </NumericTextBox> 
    </telerik:GridNumericColumnEditor> 

    I hope this gets you started properly.

    Greetings,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 09 Sep 2008 Link to this post

    Thanks for the reply.

    By default this the NumericColumnEditor appears on edit mode.

    How can I get it to appear on the default mode, since my users will make the edits right from page load.
  5. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 09 Sep 2008 Link to this post

    Hi aron,

    In this case, you can put the control in edit mode by default.
    I hope this helps.

    Greetings,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 09 Sep 2008 Link to this post

    After doing this on page load, is it still faster and less foot print than using a
    ItemTemplate with a RadNumericTextBox?
  7. Answer
    Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 09 Sep 2008 Link to this post

    Hi aron,

    Since all the items will be rendered in edit mode, there would be little difference between the two scenarios.

    Regards,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017