codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Multiple Checkbox problem with C#  frmsasp at 10:00 on Wednesday, September 28, 2005
 

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.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








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Why Use Method?
•  Re: Help with filesystem object & displaying in a table
•  Re: Genetic Algorithm Help
•  Re: How to make an investment calculator
•  Re: line breaks in GUI
•  Re: Graph in Gui...
•  Graph in Gui...
•  Re: Counting zero values in a string
•  Re: Help!


Recent Articles
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net
Creating CSS Buttons


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005