It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming C and C++ Forum

Multiple Checkbox problem with C#

Multiple Checkbox problem with C#

Postby frmsasp on Wed Sep 28, 2005 8:52 am

Dear friend,


I am new in C#. I had created DataGrid which will collect data from table. Here I had provide delete functionality like hotmail, yahoo checkbox. If user select checkbox from top header checkbox then all checkboxes are automatically selected of that particular column.

Selection/deselection will work fine. But at C# side I got "False" value only though I had selected checkbox.

e.g. First Logic
----------------

for (int i=0; i<MyDataGrid.Items.Count; i++)
{
String isChecked = ((CheckBox) MyDataGrid.Items[i].FindControl("chkSelectAll")).Checked.ToString();
Response.Write ("Delete === " + isChecked + "<BR>");
}



e.g. Second Logic
-----------------

foreach (DataGridItem objItem in MyDataGrid.Items)
{

CheckBox cb = (CheckBox)objItem.Cells[5].FindControl("chkSelectAll");
Response.Write (cb.Checked + "<br>");


if (cb.Checked)
{
command.......
}
}


Pl guide me to get out of this.


Thanking You,

Jeenec
frmsasp
 
Posts: 8
Joined: Sat Sep 03, 2005 7:02 am

Who is online

Users browsing this forum: No registered users and 0 guests