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

Changin grouping label after persisting data

5 Answers 56 Views
Persistence Framework
This is a migrated thread and some comments may be shown as answers.
Silvio Silva Junior
Top achievements
Rank 2
Silvio Silva Junior asked on 11 Sep 2013, 04:04 PM
Hello.

I'm using the RadPersistenceManager in a grid of my system. When I group by some field, no problem, the group uses the column label for its label. But when I change my page, and return to the previous page (where is my grid), the grouping is using the datafield's
name of the column.

For example:

Account
Name | Adress | Phone

After changin and returning to the page:

User.AccountDescription
Name | Adress | Phone

How can I fix it?

Regards.

5 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 16 Sep 2013, 02:53 PM
Hello Silvio,

Can you please post your RadGrid declaration?

Regards,
Daniel
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Silvio Silva Junior
Top achievements
Rank 2
answered on 16 Sep 2013, 07:59 PM

 

<telerik:RadGrid ID="grdContasPagar"
                runat="server"
                AutoGenerateColumns="false"
                OnNeedDataSource="grdContasPagar_NeedDataSource"
                OnItemDataBound="grdContasPagar_ItemDataBound"
                OnItemCommand="grdContasPagar_ItemCommand"
                OnGroupsChanging="grdContasPagar_GroupsChanging"
                ShowGroupPanel="True" ShowFooter="True" Culture="pt-BR" EnableLinqExpressions="false" GroupingSettings-RetainGroupFootersVisibility="true"
                AllowPaging="True" PageSize="50" CellSpacing="0" ShowHeader="true"
                GridLines="None" AllowSorting="True">
                <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" />
                <MasterTableView DataKeyNames="Codigo" GridLines="None" NoDetailRecordsText="Sem resultados"
                    NoMasterRecordsText="Não há Contas a Pagar Cadastradas." CommandItemDisplay="Top" ShowGroupFooter="true">                   
                    <GroupFooterTemplate>
                        Valor Total:
                        <asp:Label ID="lblValorTotal" runat="server" Text='<%#Eval("Valor") %>'>
                        </asp:Label>
                            Quantidade:
                        <asp:Label ID="lblQuantidade" runat="server" Text='<%#Eval("Codigo") %>'>
                        </asp:Label>
                    </GroupFooterTemplate>
                    <CommandItemSettings ShowExportToExcelButton="false" ShowExportToCsvButton="false"
                        ShowRefreshButton="false" ShowAddNewRecordButton="false" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Sel." UniqueName="selecione">
                            <HeaderStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                <asp:Label ID="lblSelTodos" runat="server" Text="Sel. "></asp:Label><br />
                                <asp:CheckBox ID="ckbSelTodos" runat="server" AutoPostBack="true" OnCheckedChanged="grdContasPagar_ckbSelTodos_CheckedChanged"
                                    EnableViewState="true" />
                            </HeaderTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="10px" />
                            <ItemTemplate>
                                <asp:CheckBox ID="ckbSelecione" runat="server" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="Codigo"
                            DataType="System.Int32" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Cód." UniqueName="cpd_int_codigo" Groupable="false" Aggregate="Count">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="10px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OContasPagar.OEntidade.Codigo"
                            DataType="System.String" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="EmpresaCodigo" UniqueName="ent_int_codigo" Visible="false" Groupable="false">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OContasPagar.OOrdemServico.Codigo"
                            DataType="System.Int32" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="CodigoOS" UniqueName="os_int_codigo" Visible="false">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="50px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OContasPagar.OOrdemServico.Titulo"
                            DataType="System.String" HeaderStyle-HorizontalAlign="Center" HeaderText="O.S."
                            UniqueName="os_str_titulo">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OContasPagar.OEntidadeFornecedor.Nome"
                            DataType="System.String" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Fornecedor" UniqueName="ent_str_titulo">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ODespesas.Descricao"
                            DataType="System.String" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Despesa" UniqueName="des_str_descricao">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="50px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OContasPagar.OTipoDocumento.Descricao"
                            DataType="System.String" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Tipo do Documento" UniqueName="tdc_str_descricao" Visible="false">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="50px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OContasPagar.Documento"
                            DataType="System.Int32" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Doc./NF" UniqueName="cpg_int_documento">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="50px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Titulo" DataType="System.String"
                            HeaderStyle-HorizontalAlign="Center" HeaderText="Título"
                            UniqueName="cpd_str_titulo">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="40px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Parcela" DataType="System.Int32"
                            HeaderStyle-HorizontalAlign="Center" HeaderText="Parc."
                            UniqueName="cpd_int_parcela">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="20px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Valor" DataType="System.Int32"
                            HeaderStyle-HorizontalAlign="Center" HeaderText="Valor"
                            UniqueName="cpd_dec_valor" Aggregate="Sum" FooterText="Total: " DataFormatString="{0:#,###.00}">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Right" Width="40px" />
                        </telerik:GridBoundColumn>
 
                        <telerik:GridBoundColumn DataField="OConta.Codigo"
                            HeaderStyle-HorizontalAlign="Center" HeaderText="Cód Conta" Visible="false"
                            UniqueName="con_int_codigo">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Right" Width="50px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OConta.DescComposta"
                            DataType="System.String" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Conta" UniqueName="con_str_desccomposta">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="50px" />
                        </telerik:GridBoundColumn>
 
 
                        <telerik:GridBoundColumn DataField="DataVencimento" DataType="System.DateTime"
                            HeaderStyle-HorizontalAlign="Center" HeaderText="Vencimento"
                            UniqueName="cpd_dta_vencimento" DataFormatString="{0:dd/MM/yyyy}">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="20px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OContasPagar.OCentroCusto.Descricao"
                            DataType="System.String" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Centro de Custo" UniqueName="cen_str_descricao">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="40px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Status"
                            HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Status" UniqueName="cpd_int_status">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="30px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="UltimoRetorno" DataType="System.String" Visible="false"
                            UniqueName="cpd_str_ultimoRetorno" HeaderText="Arquivo">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderText="Arquivo" UniqueName="UltimoRetorno">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="5px" />
                            <ItemTemplate>
                                <asp:Image ID="ImgArquivo" runat="server" ImageUrl="~/Content/images/relatorio_icon.png" Visible="false" ToolTip='' CssClass="InfoTip" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                </HeaderContextMenu>
                <ExportSettings>
                    <Excel Format="Biff"></Excel>
                </ExportSettings>
                <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                    <Selecting AllowRowSelect="True"></Selecting>
                    <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                        ResizeGridOnColumnResize="False"></Resizing>
                </ClientSettings>
                <GroupingSettings ShowUnGroupButton="true" GroupContinuedFormatString="" GroupContinuesFormatString="" GroupSplitDisplayFormat="" UnGroupButtonTooltip="" UnGroupTooltip="Arraste aqui os campos que vc deseja agrupar"></GroupingSettings>
                <GroupPanel Text="Arraste aqui os campos que você deseja agrupar">
                </GroupPanel>
 
            </telerik:RadGrid>
0
Daniel
Telerik team
answered on 19 Sep 2013, 01:53 PM
Hello Silvio,

Attached to this post is a simple runnable website based on your code. Can you please let me know how to modify it in order to reproduce the problem? The thing is that I'm not sure how you change this text in the code-behind.

Regards,
Daniel
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Stephen
Top achievements
Rank 1
answered on 31 Dec 2013, 04:24 PM
Has there been any resolution in this case?  I am having the exact same problem.  When I examine the GridGroupByFields in code, after the grid layout is loaded by the Persistence Framework, it looks like the header is set to null, thereby causing the grid to default to the column datafield value.  You won't see this when you do the initial grouping, only when you return to the page.  
0
Daniel
Telerik team
answered on 03 Jan 2014, 02:43 PM
Hi Stephen,

Can you please confirm that you invoke RadGrid.Rebind() after the settings are loaded?

Regards,
Daniel
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Persistence Framework
Asked by
Silvio Silva Junior
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Silvio Silva Junior
Top achievements
Rank 2
Stephen
Top achievements
Rank 1
Share this question
or