-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Akshit56491
Message 2 in Discussion

Hi,   Getting value from checkbox Control in DataGrid<O:P> </O:P> 
Our third column in DataGrid contains Checkbox web control we need to check if Checked 
property of that control is true or false.        
//Get Checked property of Checkbox control<O:P> </O:P> 
bool IsGraduate = ((CheckBox)dataGridItem.FindControl("IsGraduateField")).Checked; 
 <O:P> </O:P> 
Getting values from CheckBoxList Web Control in DataGrid:<O:P> </O:P> 
This case differs from previous one because CheckBoxList may return more then one 
value selected. We will have to iterate through CheckBoxList Items to check is user 
has selected particular item. 
 <O:P> </O:P>     
// Get Values from CheckBoxList<O:P> </O:P> 
String Skills = "";<O:P> </O:P> 
foreach(ListItem item in 
((CheckBoxList)dataGridItem.FindControl("CheckBoxList1")).Items)<O:P> </O:P> 
{<O:P> </O:P> 
      if (item.Selected){<O:P> </O:P> 
            Skills += item.Value + ",";<O:P> </O:P> 
      }<O:P> </O:P> 
}<O:P> </O:P> 
Skills = Skills.TrimEnd(','); 
  
  
Regards, 
Akshit

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to