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

RadGrid Grid Template Column

1 Answer 230 Views
Grid
This is a migrated thread and some comments may be shown as answers.
juan luis
Top achievements
Rank 1
juan luis asked on 29 Oct 2008, 11:11 PM

  Theres a problem with RadGrid template column, at footer theres 3 radnumeric textboxes inside, all three loses values after postback, whats going on?

<telerik:RadGrid ID="grid" runat="server" AllowPaging="True"
            AutoGenerateColumns="False" GridLines="None" Skin="Office2007"
            Width="862px">
<MasterTableView HierarchyLoadMode="Client" Name="master" showfooter="True">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridTemplateColumn HeaderText="Cant"
            UniqueName="cant2">
            <FooterTemplate>
                Unidades &nbsp;&nbsp;
                <br />
                <telerik:RadNumericTextBox ID="CTB_qty" Runat="server" Width="50px"
                    BorderStyle="None" ReadOnly="True">
                    <numberformat decimaldigits="2" />
                </telerik:RadNumericTextBox>
            </FooterTemplate>
            <ItemTemplate>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <telerik:RadNumericTextBox ID="CTB_cant" Runat="server"
                    Culture="English (United States)" LabelCssClass="radLabelCss_Outlook"
                    ontextchanged="RadNumericTextBox1_TextChanged" Skin="Outlook" Value="0"
                    Width="50px">
                </telerik:RadNumericTextBox>
            </ItemTemplate>
            <FooterStyle HorizontalAlign="Center" />
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle Width="0px" HorizontalAlign="Center" Height="50px" />
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="unidad" DataType="System.Single" EmptyDataText=""
            HeaderText="Unidad" ReadOnly="True" UniqueName="column1">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle Font-Bold="False" HorizontalAlign="Center" Width="50px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="cve_articulo" EmptyDataText=""
            HeaderText="Clave art" ReadOnly="True" UniqueName="clave">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle Font-Bold="False" HorizontalAlign="Center"
                Width="50px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="descripcion" EmptyDataText=""
            UniqueName="desc1" HeaderText="Descripción">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle Width="200px" Font-Bold="True" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="descripcion2" Display="False"
            EmptyDataText="&amp;nbsp;" HeaderText="Detalle" UniqueName="desc2">
            <HeaderStyle HorizontalAlign="Center" Width="200px" />
            <ItemStyle Font-Bold="True" Width="200px" />
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn HeaderText="Producto cotizado"
            UniqueName="TemplateColumn2">
            <ItemTemplate>
                Marca:<br />
                <telerik:RadTextBox ID="CTB_Marca" Runat="server"
                    EmptyMessage="Marca del producto" Skin="Outlook" Width="190px">
                </telerik:RadTextBox>
                <br />
                Modelo:<br />
                <telerik:RadTextBox ID="CTB_Modelo" Runat="server"
                    EmptyMessage="Modelo del producto" Skin="Outlook" Width="190px">
                </telerik:RadTextBox>
                <br />
                Garantía:<br />
                <telerik:RadTextBox ID="CTB_garantia" Runat="server"
                    EmptyMessage="Garantía del producto" Skin="Outlook" Width="190px">
                </telerik:RadTextBox>
            </ItemTemplate>
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle Width="200px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn HeaderText="Unitario" UniqueName="TemplateColumn">
            <FooterTemplate>
                <asp:Label ID="Label1" runat="server" Text="Subtotal:"></asp:Label>
                <br />
                <br />
                <asp:Label ID="Label4" runat="server" Text="Flete:"></asp:Label>
                <br />
                <br />
                <asp:Label ID="Label2" runat="server" Text="Impuesto:"></asp:Label>
                <br />
                <br />
                <asp:Label ID="Label3" runat="server" Text="Total:"></asp:Label>
            </FooterTemplate>
            <ItemTemplate>
                <telerik:RadNumericTextBox ID="CTB_unitario" Runat="server"
                    Culture="English (United States)" LabelCssClass="radLabelCss_Outlook"
                    Skin="Outlook" Type="Currency" Value="0" Width="85px"
                    ontextchanged="RadNumericTextBox1_TextChanged">
                    <ClientEvents OnValueChanged="OnClientValueChanged" />
                    <EnabledStyle HorizontalAlign="Right" />
                </telerik:RadNumericTextBox>
            </ItemTemplate>
            <FooterStyle HorizontalAlign="Right" />
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle Width="90px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn HeaderText="Subtotal" UniqueName="TemplateColumn1" >
            <FooterTemplate>
                <telerik:RadNumericTextBox ID="CTB_subtotal" Runat="server" BackColor="#CCFFCC"
                    ReadOnly="True" Type="Currency" Value="0" Width="85px" Font-Bold="True">
                    <DisabledStyle HorizontalAlign="Right" />
                    <EnabledStyle HorizontalAlign="Right" />
                </telerik:RadNumericTextBox>
                <br />
                <telerik:RadNumericTextBox ID="CTB_flete" Runat="server" Font-Bold="True"
                    LabelCssClass="" Skin="Outlook" Type="Currency" Value="0" Width="85px">
                    <ClientEvents OnValueChanged="OnClientValueChanged" />
                    <EnabledStyle HorizontalAlign="Right" />
                </telerik:RadNumericTextBox>
                <br />
                <telerik:RadNumericTextBox ID="CTB_iva" Runat="server"
                    Skin="Outlook" Type="Currency" Value="0" Width="85px" BackColor="#CCFFCC"
                    Font-Bold="True" LabelCssClass="" ReadOnly="True">
                    <DisabledStyle HorizontalAlign="Right" />
                    <FocusedStyle HorizontalAlign="Right" />
                    <ClientEvents OnValueChanged="OnClientValueChanged" />
                    <EnabledStyle HorizontalAlign="Right" />
                </telerik:RadNumericTextBox>
                <br />
                <telerik:RadNumericTextBox ID="CTB_total" Runat="server" BackColor="#CCFFCC"
                    ReadOnly="True" Type="Currency" Value="0" Width="85px" Font-Bold="True">
                    <DisabledStyle HorizontalAlign="Right" />
                    <clientevents onvaluechanged="OnClientValueChanged" />
                    <EnabledStyle HorizontalAlign="Right" />
                    <disabledstyle horizontalalign="Right" />
                    <enabledstyle horizontalalign="Right" />
                </telerik:RadNumericTextBox>
            </FooterTemplate>
            <ItemTemplate>
                <telerik:RadNumericTextBox ID="CTB_subtotal" Runat="server"
                    Culture="English (United States)" ReadOnly="True" Skin="Outlook"
                    Type="Currency" Value="0" Width="85px" BackColor="White"
                    BorderStyle="None">
                    <DisabledStyle HorizontalAlign="Right" />
                    <ClientEvents OnValueChanged="OnClientValueChanged" />
                    <EnabledStyle HorizontalAlign="Right" />
                </telerik:RadNumericTextBox>
            </ItemTemplate>
            <FooterStyle HorizontalAlign="Right" />
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Right" Width="100px" />
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="cant_sol" Display="False"
            EmptyDataText="&amp;nbsp;" UniqueName="cant" />
        </Columns>
</MasterTableView>

<FilterMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
        </telerik:RadGrid>

 

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 03 Nov 2008, 08:54 AM
Hello juan,

I tested the setup which you mentioned, and the control behaved as expected.
Attached to this message, you will find the code, which I used for testing. Take a look at it and let me know if I am leaving something out.

Sincerely yours,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
juan luis
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or