Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am using checkboxlist control and populating it dynamically from dataset. I want to display only text message(like No Data Avaiable) inside checkboxlist whenever there is no data in dataset. How is it possible?

Thanks
Posted

1 solution

C#
checkBoxList.Items.Add("Your message").

That should work in Win Forms.
If you want you can play with Enabled property as well.


Edit:
After reading your comment this what I have to offer:
psedocode:

if dataset has records then 
   show checkedListBox
else 
   hide checkedListBox
   show label with message.


You'll have to a label to your form for hosting a message.
That is simplest solution for your problem.

I hope this helps.
 
Share this answer
 
v2
Comments
PleaseHelpCP 29-Apr-13 6:02am    
thanks Oshtri Deka for your reply. Tried your solution but it shows message with checkbox. I want to dispaly only message. Is it possible?
Oshtri Deka 29-Apr-13 6:06am    
Yes it is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900