DataGridCommandEventArgs e 的e.Item.ItemIndex到了
GridViewCommandEventArgs e 是什么? for example:protected void DgrdBb_RowCommand(object source,GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
DataTable objDT = dbll.bSwetswswjcjbb.GetDetailsList("NULL", String.Empty).Tables[0];
for (int i = 0; i < DgrdBb.Rows.Count; i++)
{
if (i != ★e.Item.ItemIndex★)
{
DataRow oldRow = objDT.NewRow();
oldRow["jcx"] = DgrdBb.Rows[i].Cells[0].Text;
oldRow["bd_mhcs"] = Convert.ToInt32(DgrdBb.Rows[i].Cells[1].Text);
oldRow["bd_fhcs"] = Convert.ToInt32(DgrdBb.Rows[i].Cells[2].Text);
GridViewCommandEventArgs e 是什么? for example:protected void DgrdBb_RowCommand(object source,GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
DataTable objDT = dbll.bSwetswswjcjbb.GetDetailsList("NULL", String.Empty).Tables[0];
for (int i = 0; i < DgrdBb.Rows.Count; i++)
{
if (i != ★e.Item.ItemIndex★)
{
DataRow oldRow = objDT.NewRow();
oldRow["jcx"] = DgrdBb.Rows[i].Cells[0].Text;
oldRow["bd_mhcs"] = Convert.ToInt32(DgrdBb.Rows[i].Cells[1].Text);
oldRow["bd_fhcs"] = Convert.ToInt32(DgrdBb.Rows[i].Cells[2].Text);
解决方案 »
- 关于表格里嵌套datalist的问题或者反之..
- 请问 c/s 程序,客户端有数据库吗??还是直接写到文本中
- 跪求vs2008适用的分页控件!
- webdiyer的分页控件:用多重select语句然后自定义了一个参数问题,程序报错 “必须声明变量 '@categorycode'”的问题!!
- 怎样在使用用户控件的情况下生成静态页面..
- 急问,aspnet_regiis/c命令出现错误(0x80070003)
- 我的IIS突然不能用了,重启后一开始还通,过一会又说找不到服务器了
- ItemDataBound和 ItemCommand和ItemCreated区别
- asp.net生成PPT,下载到本地,该如何实现???
- 求网页制作合作伙伴(哈尔滨)
- (急)一个奇怪的问题,关于dropdownlist的取值问题!
- 接近崩溃!ActiveX控件Windows Media Player的文件路径及播放问题
{
mBookingMangager.DeleteBooking(Convert.ToInt32(grdvBooking.DataKeys[e.RowIndex].Values["BookingID"]));
BindBookingList();
}
protected void grdvBooking_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType.Equals(DataControlRowType.DataRow))
{
int iReportType = 2;
int indexCells = 4;
e.Row.Cells[indexCells].Text = Enum.GetName(typeof(MgData.SchedulTypeID), Convert.ToInt32(e.Row.Cells[indexCells].Text));
e.Row.Cells[iReportType].Text = Enum.GetName(typeof(MgData.ReportType), Convert.ToInt32(e.Row.Cells[iReportType].Text));
}
}