Cannot edit cell is an Infragistics WebDataGrid in ASP.Net 4.0 / Visual Studio 2010. Why?

5.6k Views Asked by At

My Infragistics WebDataGrid does not enter cell-edit mode when I double click a cell. It does not enter server mode - nothing happens. Only client-side events happen but I doubt those are necessary. What is wrong with the below asp.net segment?

<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 %>"
                    />
1

There are 1 best solutions below

0
On

When using TemplateDataField the controls in the template will be displayed at all times and there isn't an edit mode for these cells unless you implement that within your template. If you are looking for the default behavior where you can double click to edit a cell then you should use BoundDataField instead. If this is done then the grid will use the editor you have specified in the ColumnSettings for your CellEditing behavior.