English 中文(简体)
无法编辑的单元格是 ASP.Net 4.0 / Vision Studio 2010 中的“WebDataGrid” 系统。 为什么?
原标题:Cannot edit cell is an Infragistics WebDataGrid in ASP.Net 4.0 / Visual Studio 2010. Why?

我的次元 WebDataGrid 当我双击一个单元格时不输入单元格编辑模式。 它不输入服务器模式 - 没有发生任何事件。 只有客户端事件才会发生, 但我怀疑这些事件是必要的 。 下面的 asp. net 段有什么问题?

<infra:WebDataGrid ID="wdgProjects" runat="server" EnableAjax="true" AutoGenerateColumns="False"
                        DataSourceID="sqlProjects" DataKeyFields="ProjectID"
                        OnInitializeRow="wdgProjects_InitializeRow"
                        OnCellSelectionChanged="wdgProjects_CellSelectionChanged"
                        OnActiveCellChanged="wdgProjects_ActiveCellChanged" 
                    >
                        <Columns>
                            <infra:TemplateDataField Key="ProjectID" Header-Text="Project ID">
                                <ItemTemplate>
                                    <asp:Label ID="lblProjectID" runat="server" />
                                </ItemTemplate>
                            </infra:TemplateDataField>
                            <infra:TemplateDataField Key="ProjectName" Header-Text="Project Name">
                                <ItemTemplate>
                                    <asp:Label ID="lblProjectName" runat="server" />
                                </ItemTemplate>
                            </infra:TemplateDataField>
                            <infra:TemplateDataField Key="ReportingPeriod" Header-Text="Reporting Period">
                                <ItemTemplate>
                                    <asp:Label ID="lblReportingPeriod" runat="server" />
                                </ItemTemplate>
                            </infra:TemplateDataField>
                            <infra:TemplateDataField Key="ProjectCreator" Header-Text="Project Creator">
                                <ItemTemplate>
                                    <asp:Label ID="lblProjectCreator" runat="server" />
                                </ItemTemplate>
                            </infra:TemplateDataField>
                            <infra:TemplateDataField Key="ProjectCreation" Header-Text="Project Creation Date">
                                <ItemTemplate>
                                    <asp:Label ID="lblProjectCreation" runat="server" />
                                </ItemTemplate>
                            </infra:TemplateDataField>
                        </Columns>
                        <Behaviors>
                            <infra:Activation Enabled="true" />
                            <infra:Selection RowSelectType="Single" CellClickAction="Cell" />
                            <infra:EditingCore AutoCRUD="false" Enabled="true" BatchUpdating="false">
                                <Behaviors>
                                    <infra:CellEditing Enabled="true" EditModeActions-MouseClick="Double">
                                        <ColumnSettings>
                                            <infra:EditingColumnSetting ColumnKey="ProjectID" ReadOnly="true" />
                                            <infra:EditingColumnSetting EditorID="txtProjectName" ColumnKey="ProjectName" />
                                            <infra:EditingColumnSetting EditorID="ddlReportingPeriod" ColumnKey="ReportingPeriod"/>
                                            <infra:EditingColumnSetting EditorID="txtProjectCreator" ColumnKey="ProjectCreator" />
                                            <infra:EditingColumnSetting EditorID="calProjectCreation" ColumnKey="ProjectCreation" />
                                        </ColumnSettings>
                                    </infra:CellEditing>
                                    <infra:RowAdding Alignment="Bottom" EditModeActions-MouseClick="Double"/>
                                    <infra:RowDeleting Enabled="true" />
                                </Behaviors>
                            </infra:EditingCore>
                            <infra:Sorting>
                                <ColumnSettings>
                                    <infra:SortingColumnSetting ColumnKey="ProjectID" />
                                    <infra:SortingColumnSetting ColumnKey="ProjectName" />
                                    <infra:SortingColumnSetting ColumnKey="ReportingPeriod" />
                                    <infra:SortingColumnSetting ColumnKey="ProjectCreator" />
                                    <infra:SortingColumnSetting ColumnKey="ProjectCreation" />
                                </ColumnSettings>
                            </infra:Sorting>
                            <infra:Paging PageSize="15" />
                        </Behaviors>
                        <EditorProviders>
                            <infra:TextEditorProvider ID="txtProjectName">
                                <EditorControl ClientIDMode="Predictable"/>
                            </infra:TextEditorProvider>
                            <infra:DropDownProvider ID="ddlReportingPeriod">
                                <EditorControl DataSourceID="sqlReportingPeriod" TextField="Name" ValueField="Value"
                                    EnableDropDownAsChild="False" DisplayMode="DropDownList" ClientIDMode="Predictable" DropDownContainerMaxHeight="200px"
                                >
                                    <DropDownItemBinding TextField="Name" ValueField="Value" />
                                </EditorControl>
                            </infra:DropDownProvider>
                            <infra:TextEditorProvider ID="txtProjectCreator">
                                <EditorControl ClientIDMode="Predictable"/>
                            </infra:TextEditorProvider>
                            <infra:WebDateChooserProvider ID="calProjectCreation"/>
                        </EditorProviders>
                        <AjaxIndicator Enabled="True" />
                    </infra:WebDataGrid>

                    <asp:SqlDataSource runat="server" ID="sqlProjects" ConnectionString="<%$ ConnectionStrings:HelloUranus %>"
                        SelectCommand="<%$ AppSettings:GetProjects %>" SelectCommandType="StoredProcedure"
                        InsertCommand="<%$ AppSettings:InsertProject %>" InsertCommandType="StoredProcedure"
                        UpdateCommand="<%$ AppSettings:UpdateProject %>" UpdateCommandType="StoredProcedure"
                        DeleteCommand="<%$ AppSettings:DeleteProject %>" DeleteCommandType="StoredProcedure"
                        OnSelecting="sqlProjects_Selecting"
                        OnUpdating="sqlProjects_Updating"
                    >
                        <SelectParameters>
                            <asp:Parameter Name="ProjectID" Type="Int32" />
                            <asp:Parameter Name="ProjectName" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource runat="server" ID="sqlReportingPeriod" ConnectionString="<%$ ConnectionStrings:Floobarf %>"
                        SelectCommand="<%$ AppSettings:ReportingPeriods %>"
                    />
问题回答

当使用 TextData Field 时, 模板中的控件将随时显示, 除非您在模板中执行, 否则这些单元格就不会有编辑模式。 如果您正在寻找默认行为, 您可以双击来编辑单元格, 那么您应该使用 BoundData Field 来代替。 如果这样做了, 网格将会使用您在列设置中指定的编辑器, 用于您的单元格编辑行为 。





相关问题
• 接送一页

录像图像和javascript文档位于服务器上:“

Infragistics components on build server

I have "inherited" a new (old?) Winforms project and would like to put it onto our build server (Bamboo). That build server has only the absolute minimum (.NET 3.5 and not much more) installed, and we ...

Styling WPF controls inline with Infragistics themes

we are using Infragistics WPF controls (e.g. xamDataGrid, xamDockManager etc), and we will be using the Infragistics Office 2007 Blue theme which these controls support. We also want to style the ...

Why the toolbar button icon is grey at runtime?

I"m setting the icon of a toolbar button (using Infragistics component library for the toolbar), The problem is that on design time the icon is showing normally. But at runtime the icon become greyed, ...

specific context menu per UltraTreeNode

I have a problem using Infragistics UltraTree control. I need a way to add a specific context menu to an UltraTreeNode. I saw that there is a contextMenu property for the UltraTree, but I need a ...

How to refresh an Infragistics UltraGrid?

I am using Infragistics UltraGrid with datasouce Windows Bindingsouce. On change, I provide datasouce to Bindingsouce and call DataBinding of UltraGrid. Value in the datasouce of Bindingsouce changes, ...

热门标签