【问题标题】:Adding new row to Gridview explanation将新行添加到 Gridview 说明
【发布时间】:2014-08-08 12:16:45
【问题描述】:

我在c#中有以下代码,

GridView grdViewOrders = (GridView)sender;
            GridViewRow row = new GridViewRow(0, 0, DataControlRowType.DataRow, DataControlRowState.Insert);
            TableCell cell = new TableCell();
            cell.Text = "Customer Name : " + DataBinder.Eval(e.Row.DataItem, "CustomerName").ToString();
            cell.ColumnSpan = 6;
            cell.CssClass = "GroupHeaderStyle";
            row.Cells.Add(cell);
            grdViewOrders.Controls[0].Controls.AddAt(e.Row.RowIndex + intSubTotalIndex, row);
            intSubTotalIndex++;

我需要一些关于这条线的解释

GridViewRow row = new GridViewRow(0, 0, DataControlRowType.DataRow, DataControlRowState.Insert);

GridViewRow的构造函数中第一个第二个和第四个参数是什么

谢谢

【问题讨论】:

标签: c# asp.net .net gridview


【解决方案1】:

查看链接 - GridViewRow Constructor

  1. rowIndex :GridViewRow 对象在 GridView 控件的 Rows 集合中的索引。
  2. dataItemIndex :DataItem 在底层 DataSet 中的索引。
  3. rowType :DataControlRowType 枚举值之一。
  4. rowState :DataControlRowState 枚举值的按位组合。

这是你需要的吗?

【讨论】:

    猜你喜欢
    • 2014-08-21
    • 1970-01-01
    • 2011-08-29
    • 2011-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多