使用columngroup进行Radgrid批量编辑

时间:2014-07-22 08:36:48

标签: c# telerik radgrid

我使用的是2013.2.611.40 Telerik RadGrid。

我尝试将批处理编辑模式与GridTemplateColumn一起使用。如果我指定ColumnGroup属性,则单击单元格时会在_isColumnEditable中引发JavaScript错误(无法获取未定义或null引用的属性_data)。如果删除ColumnGroup属性,则一切正常,并显示编辑文本框。

<telerik:RadGrid ID="MyGrid" runat="server" AutoGenerateColumns="false" Skin="Simple" AllowPaging="False" AllowSorting="true" AllowFilteringByColumn="true" AllowMultiRowSelection="true"   OnPreRender="GridLastPhase_PreRender"   OnNeedDataSource="GridLastPhase_NeedDataSource" OnItemDataBound="GridLastPhase_ItemDataBound">  
<ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
    <MasterTableView HeaderStyle-HorizontalAlign="Center" Width="99%" EditMode="Batch">
        <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click" />
        <ColumnGroups>
            <telerik:GridColumnGroup Name="LQP1" HeaderText="Last Q Phase 1" HeaderStyle-HorizontalAlign="Center" />
        </ColumnGroups>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="" AllowFiltering="false" HeaderStyle-Width="40px" ItemStyle-Width="40px">
                <ItemTemplate>
                    <asp:Label ID="lblRowNumber" runat="server"></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridClientSelectColumn>
                <HeaderStyle Width="40px" HorizontalAlign="Center" />
                <ItemStyle Width="40px" HorizontalAlign="Center" />
            </telerik:GridClientSelectColumn>
            <telerik:GridTemplateColumn AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="100%" UniqueName="LQP1_PHASE_DESCRIPTION" HeaderText="Phase" DataType="System.String" DataField="LQP1_PHASE_DESCRIPTION" SortExpression="LQP1_PHASE_DESCRIPTION" ColumnGroupName="LQP1" HeaderStyle-Width="110px" ItemStyle-Width="110px">
                <ItemTemplate>
                    <asp:Label ID="lblLQP1_PHASE" runat="server" Text='<%#Eval("LQP1_PHASE_DESCRIPTION")%>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtLQP1_PHASE" runat="server" Text='<%#Eval("LQP1_PHASE_DESCRIPTION")%>'></asp:TextBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

1 个答案:

答案 0 :(得分:0)

已解决最新版本的Telerik控件。