缺少GridView垂直线。如何添加它。在asp.net C#和Telerik中

时间:2016-03-03 13:28:30

标签: asp.net telerik telerik-grid

我正在运行我的代码。我已经创建了你在图片上看到的表格,但是我看不到新的直线 HeaderText这一行。

我正在使用带有Telerik的ASP.net C#。

**但是我缺少什么才能显示该行?**

请帮忙!

** GridView代码**

<div id="divMainGrid" runat="server" style="height: 700px">
   <p>
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" GridLines="None" ToolTip="Click on a row to select a setting." AllowPaging="true"
            CssClass="AddBorders" ShowFooter="false" Width="100%" AllowFilteringByColumn="true" AllowSorting="true"
             Visible="true" 
            OnDetailTableDataBind="RadGrid1_DetailTableBind"
            OnNeedDataSource="radGrid_DataSource"
            EnableHierarchyExpandAll="false">


              <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />

            <ClientSettings EnablePostBackOnRowClick="false" EnableRowHoverStyle="true" AllowColumnsReorder="true">
                <Resizing AllowColumnResize="false" />
                <Selecting AllowRowSelect="false" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" EnableVirtualScrollPaging="false" ScrollHeight="490px" FrozenColumnsCount="3" />
            </ClientSettings>

            <GroupingSettings CaseSensitive="false" />

             <MasterTableView Width="100%" DataKeyNames="AssetClass_ID, AssetCategory_ID" TableLayout="Fixed">
                <ColumnGroups>
                    <telerik:GridColumnGroup Name="DepreciationAmortisationMethod" HeaderText="Depreciation/Amortisation Method"  HeaderStyle-HorizontalAlign="Center">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup Name="MeasurementModel" HeaderText="Measurement Model" HeaderStyle-HorizontalAlign="Center">
                    </telerik:GridColumnGroup>
                     <telerik:GridColumnGroup Name="RevaluationModel" HeaderText="Revaluation Model" HeaderStyle-HorizontalAlign="Center">
                    </telerik:GridColumnGroup>
                </ColumnGroups>
                <DetailTables>                        
                    <telerik:GridTableView DataKeyNames="AssetClass_ID, AssetCategory_ID" Name="CategoryDetails" EnableHierarchyExpandAll="false" HierarchyLoadMode="ServerOnDemand"  AutoGenerateColumns="false">
                        <Columns>                               
                            <telerik:GridBoundColumn DataField="AssetCategory_ID" HeaderText="Asset Category ID" UniqueName="AssetCategory_ID" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="5px" Visible="false" />
                            <telerik:GridBoundColumn DataField="CategoryDescription" HeaderText="Asset Category Description" UniqueName="CategoryDescription" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="104px" />

&LT;% -                                                                              &#39;&GT;                                                                      

                            <telerik:GridTemplateColumn ColumnEditorID="colEditMonths" DataField="UsefulLifeMonth" HeaderText="Months" UniqueName="Months" HeaderStyle-Width="85px" ColumnGroupName="UsefulLife">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtMonths" runat="server" Width="85px" ReadOnly="false" ViewStateMode="Enabled" Text='<%# Eval("UsefulLifeMonth").ToString()%>'></asp:TextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>--%>
                        </Columns>                           
                    </telerik:GridTableView>                   
                </DetailTables>

                <Columns>         

                    <telerik:GridTemplateColumn ColumnEditorID="colEditChkbox" HeaderText="Select" UniqueName="SelectAsset" AllowFiltering="false" HeaderStyle-Width="45px" >

                          <ItemTemplate>
                              <asp:CheckBox ID="chkSelectAsset" runat="server" Text="Select"  EnableViewState="true" />
                          </ItemTemplate>
                      </telerik:GridTemplateColumn> 

                   <telerik:GridBoundColumn DataField="AssetClass_ID" HeaderText="Asset Class ID" UniqueName="AssetClass_ID" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="5px" Visible="false" />
                   <telerik:GridBoundColumn DataField="AssetClassDescription" HeaderText="Asset Class Description" UniqueName="AssetCategory_ID" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="175px" Visible="true" ColumnGroupName="DepreciationAmortisationMethod" />

                    <telerik:GridTemplateColumn ColumnEditorID="colEdit_StraightLineID" DataField="StraightLine" HeaderText="Straight Line" UniqueName="StraightLineID" AllowFiltering="false" HeaderStyle-Width="140px" ItemStyle-VerticalAlign="Top" ColumnGroupName="DepreciationAmortisationMethod">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbStraightLine"  runat="server" CausesValidation="true"  GroupName="DepreciationAmortisationMethod" Checked='<%# Convert.ToBoolean(Eval("StraightLine")) == false ? false : Convert.ToBoolean(Eval("StraightLine"))%>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn ColumnEditorID="colEdit_DiminishingBalanceInitialYear" DataField="DiminishingBalanceInitialYear" HeaderText="Diminishing Balance Initial Year" UniqueName="DiminishingBalanceInitialYear" AllowFiltering="false" HeaderStyle-Width="140px" ColumnGroupName="DepreciationAmortisationMethod">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbDiminishingBalanceInitialYear" runat="server" CausesValidation="true" GroupName="DepreciationAmortisationMethod" Checked='<%# Convert.ToBoolean(Eval("DiminishingBalanceInitialYear")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn ColumnEditorID="colEdit_DiminishingBalanceSubsequentYear" DataField="DiminishingBalanceSubsequentYear" HeaderText="Diminishing Balance SubsequentYear" UniqueName="DiminishingBalanceSubsequentYear" AllowFiltering="false" HeaderStyle-Width="140px" ColumnGroupName="DepreciationAmortisationMethod">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbDiminishingBalanceSubsequentYear" runat="server" CausesValidation="true" GroupName="DepreciationAmortisationMethod" Checked='<%# Convert.ToBoolean(Eval("DiminishingBalanceSubsequentYear")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn ColumnEditorID="colEdit_UnitsOfProduction" DataField="UnitsOfProduction" HeaderText="Units Of Production" UniqueName="UnitsOfProduction" AllowFiltering="false" HeaderStyle-Width="140px" ColumnGroupName="DepreciationAmortisationMethod">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbUnitsOfProduction" runat="server" CausesValidation="true" GroupName="DepreciationAmortisationMethod" Checked='<%# Convert.ToBoolean(Eval("UnitsOfProduction")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn ColumnEditorID="colEdit_Cost" DataField="Cost" HeaderText="Cost" UniqueName="Cost" AllowFiltering="false" HeaderStyle-Width="140px" ColumnGroupName="MeasurementModel">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbCost" runat="server" CausesValidation="true" GroupName="MeasurementModel" Checked='<%# Convert.ToBoolean(Eval("Cost")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn ColumnEditorID="colEdit_RevaluedAmount" DataField="RevaluedAmount" HeaderText="RevaluedAmount" UniqueName="RevaluedAmount" AllowFiltering="false" HeaderStyle-Width="140px" ColumnGroupName="MeasurementModel">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbRevaluedAmount" runat="server" CausesValidation="true" GroupName="MeasurementModel" Checked='<%# Convert.ToBoolean(Eval("RevaluedAmount")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn ColumnEditorID="colEdit_FairValue" DataField="FairValue" HeaderText="Fair Value" UniqueName="FairValue" AllowFiltering="false" HeaderStyle-Width="140px" ColumnGroupName="MeasurementModel">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbFairValue" runat="server" CausesValidation="true" GroupName="MeasurementModel" Checked='<%# Convert.ToBoolean(Eval("FairValue")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                      <telerik:GridTemplateColumn ColumnEditorID="colEdit_DepreciationProportionately" DataField="DepreciationProportionately" HeaderText="Restatement of Accumulated Depreciation Proportionately" UniqueName="DepreciationProportionately" AllowFiltering="false" HeaderStyle-Width="180px" ColumnGroupName="RevaluationModel">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbDepreciationProportionately" runat="server" CausesValidation="true" GroupName="RevaluationModel" Checked='<%# Convert.ToBoolean(Eval("DepreciationProportionately")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                      <telerik:GridTemplateColumn ColumnEditorID="colEdit_AccumulatedDepreciation" DataField="AccumulatedDepreciation" HeaderText="Accumulated Depreciation Eliminated against Gross Carrying Amount of the Asset" UniqueName="AccumulatedDepreciation" AllowFiltering="false" HeaderStyle-Width="180px" ColumnGroupName="RevaluationModel">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdbAccumulatedDepreciation" runat="server" CausesValidation="true" GroupName="RevaluationModel" Checked='<%# Convert.ToBoolean(Eval("AccumulatedDepreciation")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

                </Columns>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False" />
        </telerik:RadGrid>
    </p>
</div>

GridView Image

1 个答案:

答案 0 :(得分:0)

我知道在使用静态标题和冻结列时曾经存在一些问题,但我认为它们已得到解决。尝试最新版本(在撰写本文时:2015.1.225的数字,2016年第一季度的SP1&#34;单词&#34;)也许事情会好起来的。如果没有,请打开Telerik的票证。