1
我有一個gridview,我想增加一列的大小在它當用戶點擊編輯鏈接按鈕使用此代碼,奇的GridView列大小
protected void RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState == DataControlRowState.Edit)
{
// Comments
TextBox comments = (TextBox)e.Row.Cells[column_index].Controls[control_index];
comments.TextMode = TextBoxMode.MultiLine;
comments.Height = 100;
comments.Width = 400;
}
}
問題
它的工作原理,但只適用於奇數Gridview行,並休息甚至行數保持不變,任何人都可以指導我解決方案嗎?
可你是位清晰,詳細點嗎? – Sakthivel
'column_index'和'control_index'的值是多少? –
3和0 respectivily – Mathematics