datagrid checkbox

Results 1 to 2 of 2

Thread: datagrid checkbox

  1. #1
    Join Date
    Dec 1969

    Default datagrid checkbox

    I have a button column that when pressed, i need hte corresponding checkbox to be set to false,<BR><BR>I can get all teh boxes to go to false by <BR> foreach ( DataGridItem DGitem in MyDataGrid.Items ) <BR> {<BR> <BR> bool IsReportSelected = ((CheckBox)DGitem.FindControl ("Chk1")).Checked; <BR> <BR> if(IsReportSelected) <BR> ((CheckBox)DGitem.FindControl("Chk1")).Checked=fal se;<BR> }<BR><BR><BR>This works for all rows,<BR><BR>but how can i make it do just one row<BR>I need to use<BR><BR>((CheckBox)DGitem.FindControl("Chk1")). Checked; <BR><BR>but the the DGItme is made in the for loop... how can i do this <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: datagrid checkbox

    public void MyDataGrid_Click(Object sender, DataGridEventsArgs e){<BR> ((CheckBox)DGItem.Items(e.Item.ItemIndex).FindCont rol("Chk1")).Checked = false;<BR>}<BR><BR>Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts