- 积分
- 0
- 在线时间
- 0 小时
- 主题
- 1
- 注册时间
- 2014-3-20
- 帖子
- 1
- 最后登录
- 2014-3-20
- 帖子
- 1
- 软币
- 57
- 在线时间
- 0 小时
- 注册时间
- 2014-3-20
|
aspx:
- <dx:ASPxGridView ID="Grid" ClientInstanceName="Grid" KeyFieldName="MOVID" runat="server"
- AutoGenerateColumns="False" Width="100%" OnPageIndexChanged="Grid_PageIndexChanged"
- OnHtmlRowCreated="Grid_HtmlRowCreated">
- <Columns>
- <dx:GridViewDataColumn Name="GridViewDataColumnCheckBoxSelectRow" FieldName="WebStudentID"
- Caption="Include" VisibleIndex="0">
- <DataItemTemplate>
- <dx:ASPxCheckBox ID="ASPxCheckBox1" runat="server">
- </dx:ASPxCheckBox>
- </DataItemTemplate>
- </dx:GridViewDataColumn>
- </Columns>
- </dx:ASPxGridView>
复制代码
C#:
- public void Relase(object sender, EventArgs e)
- {
- int startid = Grid.PageIndex * Grid.SettingsPager.PageSize;
- int endid;
- if (Grid.PageIndex == Grid.PageCount - 1)
- {
- endid = Grid.VisibleRowCount;
- }
- else
- {
- endid = (Grid.PageIndex + 1) * Grid.SettingsPager.PageSize;
- }
- for (int i = startid; i < endid; i++)
- {
- ASPxCheckBox editor = Grid.FindRowCellTemplateControl(i, (GridViewDataColumn)Grid.Columns[0], "ASPxCheckBox1") as ASPxCheckBox;
- }
- }
复制代码
选择 ASPxCheckBox 后,获取editor总是为假。什么原因,应该怎么样写正确。
|
|