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

Group By Expression Lost After Ajax Rebind

1 Answer 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 03 Jun 2013, 09:10 PM
Help! I can successfully open, close and rebind the Grid after the RadWindow is opened and closed but the group by expressions do not appear until I refresh the page.

How do I get the rebind to include the grid group by fields? The online demos don't mention it and I can't find any solutions...

Thanks.

JavaScript...
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function ShowInsertForm() {
            window.radopen("newrp.aspx", "RW_RP");
            return false;
        }
 
        function refreshGrid(arg) {
            if (!arg) {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            }
 
            else {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
            }
        }
 
        function RowDblClick(sender, eventArgs) {
            window.radopen("newrp.aspx?nbid=" + eventArgs.getDataKeyValue("nbid") + "&cocc=" + eventArgs.getDataKeyValue("cocc") + "&tm=" + eventArgs.getDataKeyValue("teammate") + "&dot7=" + eventArgs.getDataKeyValue("dot7"), "RW_RP");
        }
    </script>
</telerik:RadCodeBlock>

ASPX...
<telerik:RadGrid ID="RG_RP" runat="server" CellSpacing="0" GridLines="None" style="margin:10px">
    <MasterTableView AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AlternatingItemStyle-HorizontalAlign="Center" CommandItemDisplay="Top" ClientDataKeyNames="nbid, cocc, teammate, dot7">
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="Teammate" FieldAlias="Teammate" HeaderValueSeparator=": " />
                </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="Teammate" FieldAlias="Teammate" SortOrder="Ascending" />
                </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <Columns>
... SOME COLUMNS ...
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
        <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Add new preferences"></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>
        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
        <CommandItemTemplate>
            <div style="padding:5px 0px 5px 10px">Double click a row to add a preference for that Teammate</div>
        </CommandItemTemplate>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnRowDblClick="RowDblClick" />
    </ClientSettings>
    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
    <FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>



1 Answer, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 03 Jun 2013, 11:23 PM
Nevermind, I figured it out. I used the demo and forgot that the code behind cleared the sort and group by expressions.

Thanks.
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Matt
Top achievements
Rank 1
Share this question
or