当数据源为空时,radgrid mastertableview不显示标题

时间:2018-11-28 00:22:08

标签: radgrid

<telerik:RadGrid ID="rgFreightOptions" OnNeedDataSource="rgFreightOptions_NeedDataSource" OnItemCreated="rgFreightOptions_ItemCreated" OnItemDataBound="rgFreightOptions_ItemDataBound"
                    ShowStatusBar="true" runat="server" AllowPaging="false" AllowSorting="false" AllowMultiRowSelection="false" AutoGenerateColumns="false"  Skin="Default" EnableEmbeddedSkins="false" >
                    <PagerStyle AlwaysVisible="true" PageSizeControlType="RadDropDownList" />
                    <MasterTableView ShowHeadersWhenNoRecords="true" NoMasterRecordsText="Currently, No records">

                        <Columns>
                            ...//some columns here
                        </Columns>
                    </MasterTableView>                    
                    <ClientSettings EnableRowHoverStyle="false" >
                        <ClientEvents OnGridCreated="onGridCreated" />
                    </ClientSettings>
                </telerik:RadGrid>

                <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
                    <script type="text/javascript">

                        function EditingAddress(sender, eventArgs)
                        {
                            var masterTableView = $find('<%=rgFreightOptions.ClientID %>').get_masterTableView();
                            var data = [];
                            masterTableView.set_dataSource(data); 
                            masterTableView.dataBind();
                        }

                   </script>
                </telerik:RadCodeBlock>

对于上面的Radgrid,我还有另一个输入,其事件为onkeydown =“ editingAddress()”。编辑输入后,Radgrid中的预设记录将按预期消失,但是mastertableview标头“当前,没有记录”不会显示。请帮忙。

0 个答案:

没有答案