2012-01-26 15 views

答えて

4

(編集、削除、選択ボタンがある場所によって異なる場合があります)。私は、グリッドビューを追加し、最初の列にボタンを持っています。次に、RowDataBoundイベントでこれを追加しました。

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
    { 
     if (e.Row.RowType == DataControlRowType.DataRow) { 

      LinkButton lbEdit = (LinkButton)e.Row.Cells[0].Controls[0]; 
      lbEdit.Text = "<img src='https://www.google.com/logos/classicplus.png' />"; 
      //There is a literal in between 
      LinkButton lbDelete = (LinkButton)e.Row.Cells[0].Controls[2]; 
      lbDelete.Text = "<img src='https://www.google.com/logos/classicplus.png' />"; 
      //There is a literal in between 
      LinkButton lbSelect = (LinkButton)e.Row.Cells[0].Controls[4]; 
      lbSelect.Text = "<img src='https://www.google.com/logos/classicplus.png' />"; 

     } 
    } 

幸運を祈る!

関連する問題