Microsoft Developer Network > 포럼 홈 > Visual C# General > Add Checkbox in gridview groupheader
질문하기질문하기
 

답변됨Add Checkbox in gridview groupheader

  • 2009년 11월 7일 토요일 오후 1:00Ranjani 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음
    Hi All,

    I have a gridview with groupheader containing checkbox. If i select the checkbox all the checkboxes in the group should be selected.

    Please find my code below.
     TableCell newCell = new TableCell();
                                newCell.ColumnSpan = this.gvTeamAssignmentList.Columns.Count;
                                newCell.BackColor = System.Drawing.Color.FromArgb(255, 248, 242);
                                newCell.ForeColor = System.Drawing.Color.Black;
                                newCell.Font.Bold = true;
                                newCell.Text = strTeamName;
                                //Creating Checkbox
                                CheckBox chk = new CheckBox();
                                chk.Text = strTeamName;
                                chk.CheckedChanged += new EventHandler(chk_CheckedChanged);
                                newCell.Controls.Add(chk);
    
    
                                groupHeaderRow.Cells.Add(newCell);
                                table.Controls.AddAt(realIndex, groupHeaderRow);
    
    Please tell me if i check the header checkbox how to check the values of the child checkboxes

답변

모든 응답