Multiple Checkbox problem with C#

This is a discussion on "Multiple Checkbox problem with C#" within the ASP.NET Forum section. This forum, and the thread "Multiple Checkbox problem with C# are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 28th, 2005, 09:06
New Member
Join Date: Sep 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Multiple Checkbox problem with C#

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 + "
");
}



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

foreach (DataGridItem objItem in MyDataGrid.Items)
{

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


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


Pl guide me to get out of this.


Thanking You,

Jeenec
Reply With Quote

Reply

Tags
multiple, checkbox, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem sending Multiple Attachments w/Email wacara Classic ASP 0 Aug 9th, 2007 19:50
Validatwe multiple checkbox with array [] Mochachino JavaScript Forum 0 May 5th, 2007 04:44
Problem accessing multiple databases, not at the same time.. poisedforflight PHP Forum 2 Nov 21st, 2005 13:25
Validation problem with multiple submit buttons celia05es JavaScript Forum 2 Sep 29th, 2005 08:19
CheckBox problem with ASP.Net DataGrid frmsasp ASP.NET Forum 2 Sep 28th, 2005 09:04


All times are GMT. The time now is 15:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43