我的Webdatagrid看起来很纯洁。
<igg:WebDataGrid ID="GridLocations" runat="server" AutoGenerateColumns="false" DataKeyFields="LocationGuid"
EnableDataViewState="True" OnRowUpdating="GridLocations_RowUpdating" OnColumnSorted="GridLocations_ColumnSorted"
OnPageIndexChanged="GridLocations_PageIndexChanged" Height="1000px">
<ClientEvents Click="onClickGridLocations" Initialize="onInitializeGridLocations" MouseOver="onMouseOverGridLocations" />
<Behaviors>
<igg:Selection Enabled="true" CellSelectType="Single" CellClickAction="Cell" RowSelectType="Single"></igg:Selection>
<igg:Sorting Enabled="true"></igg:Sorting>
<igg:Paging Enabled="false" PageSize="20" QuickPages="20" PagerMode="NumericFirstLast"></igg:Paging>
<igg:ColumnResizing Enabled="true"></igg:ColumnResizing>
<igg:ColumnMoving Enabled="true"></igg:ColumnMoving>
<igg:EditingCore>
<Behaviors>
<igg:CellEditing>
<ColumnSettings></ColumnSettings>
</igg:CellEditing>
</Behaviors>
</igg:EditingCore>
</Behaviors>
</igg:WebDataGrid>
我在后面的代码中添加了一个unboundfield复选框
//Create a new DataGrid field and set relevant properties
updateField = new UnboundCheckBoxField();
updateField.Key = dc.ColumnName;
updateField.Header.Text = "Update";
updateField.HeaderCheckBoxMode = Infragistics.Web.UI.CheckBoxMode.BiState;
updateField.Width = Unit.Pixel(70);
updateField.CssClass = "AlignLeft";
//Add field to the grid control
GridLocations.Columns.Add(updateField);
//Add column setting that enables the column being edited
setting = new EditingColumnSetting();
setting.ColumnKey = dc.ColumnName;
setting.ReadOnly = false;
GridLocations.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(setting);
当选择单行或多行时,它会在页面提交时触发Webdatagrid _RowUpdating事件,但在“按标题选择全部”复选框时不会触发。
我认为需要额外的代码来完成任务。那可能是什么?