Re: [RESOLVED] iteration from the database
Code:
private void linkUser_Click(object sender, EventArgs e)
{
if(circumstancePanel.Controls!=null){
for (int i = this.Controls.Count - 1; i >= 0; i--){
Control c = this.Controls[i];
// now we check if the control is a checkbox
if (c.GetType() == typeof(CheckBox) {
((CheckBox)c).Checked = true;
}
}
}
Hope that helps
Re: [RESOLVED] iteration from the database
I am on it now. Heartily say thanks for your good contributions.
Re: [RESOLVED] iteration from the database
Code:
int counter = 0;
Control control = new Control();
if(rolePanel.Controls !=null){
if(control.GetType()==typeof(CheckBox)){
if(((CheckBox)control).Checked==true){
//Not the right code
foreach(((CheckBox)control).Checked in rolePanel.Controls.Count){
}
}
}
}
}
Thanks for your help. This lines of code given me is well explanatory. What i want to achieve is to count the number of selected or checked checkbox(es). How do I get it?
Re: [RESOLVED] iteration from the database
Code:
int counter = 0; define this in the header of the class (panel or form)
// in the event delegate where you want to count do the following
if(rolePanel.Controls !=null){
foreach(Control c in rolePanel.Controls){
if(c.GetType()==typeof(CheckBox)){
if(((CheckBox)c).Checked==true){
this.counter ++;
}
}
}
}
BTW zip the program and add it here so I can have a look to it
Its much easier then to help you
Before doing so remove all files in the obj and the bin folder so there is no exe file included to the zip file
1 Attachment(s)
Re: [RESOLVED] iteration from the database
On this project I have
1. 10 tables in LinksApplication database
2. 10 forms which could be selected from the combobox on LinkUser form
3. Each 10 forms can insert, update, delete from the database tables that bears their name
4. 3 forms that has 10 panels each: LinkUser, CurrentUser, AllUser to display iterated database table items based on what they are to do
The one I am working on now is LinkUser interface which has 10 panels, 3 buttons-linkUser, allUser, currentUser
This is what I want to achieve:
Each panel gets the values from the tables specific to each.
It assigns radiobutton to value in the Person table and display them on personPanel
It assigns checkbox to value in the other tables and add them to their respective panels.
This is what I want to do. As i am working on LinkUser form. When a value(radiobutton) is selected on personPanel and some checkboxes are checked on rolePanel, circumstancePanel, problemPanel and the LinkUser button is clicked it should assign the checked checkboxes as it values.
Now if I open the CurrentUser form that conains the personPanel items from the database table(Person) and click on any of the radiobutton it should automatically display the selected values on respectively on other panels in the CurrentUser form.
Hope I am much communicating. Thanks.
I would thank you from the bottom of my heart
Re: [RESOLVED] iteration from the database
You did an error The zip file only contains the dln file nothing else But you should dsend all teh application including fatabase only not including any file located in the bin or object folder,
Simple delete all stuff in that folders, They will be created automatically when you are compiling the project next time
All the cs files of the project, the database and resources are needed
Re: [RESOLVED] iteration from the database
The files are bigger that the forum required so it gives me an error of file too big whenever I want to upload to the forum. Is there any better way I could do it? Thanks. Goodmorinig.
Re: [RESOLVED] iteration from the database
Quote:
Originally Posted by
ken4ward
The files are bigger that the forum required so it gives me an error of file too big whenever I want to upload to the forum. Is there any better way I could do it? Thanks. Goodmorinig.
click to my name and write me an email. Sendd the file that way
Re: [RESOLVED] iteration from the database
Code:
private void solutionPanel_MouseHover(object sender, EventArgs e)
{
Intermediate intermediate = new Intermediate();
DialogResult dialogues = intermediate.ShowDialog();
if (e.Equals("solutionPanel"))
{
personPanel.Visible = false;
}
else
{
personPanel.Visible = true;
}
please I want this if I hover solutionPanel should become invisible and intermediate dialog should show. everything is ok but only the if statement. Thanks. So much appreciate your efforts sir. Words can not well compliment your support.
Re: [RESOLVED] iteration from the database
Code:
private void solutionPanel_MouseHover(object sender, EventArgs e)
{
Intermediate intermediate = new Intermediate();
DialogResult dialogues = intermediate.ShowDialog();
// code is waiting until dialog is closed
if (e.Equals("solutionPanel"))
{
personPanel.Visible = false;
}
else
{
personPanel.Visible = true; }
This cannot do the job, because after you do the show dialog the eexecution of this command halts until the dialog is closed That way your cisible, invisble will not be executed
Put the show dialog in the last line of that commands
Re: [RESOLVED] iteration from the database
Quote:
Originally Posted by
ken4ward
On this project I have
1. 10 tables in LinksApplication database
....
The one I am working on now is LinkUser interface which has 10 panels, 3 buttons-linkUser, allUser, currentUser
This is what I want to achieve:
Each panel gets the values from the tables specific to each.
It assigns radiobutton to value in the Person table and display them on personPanel
....
This is what I want to do. As i am working on LinkUser form. When a value(radiobutton) is selected on personPanel and some checkboxes are checked on rolePanel, circumstancePanel, problemPanel and the LinkUser button is clicked it should assign the checked checkboxes as it values.
Now if I open the CurrentUser form that conains the personPanel items from the database table(Person) and click on any of the radiobutton it should automatically display the selected values on respectively on other panels in the CurrentUser form.
...
The problem is I cannot find any of the code you have already shown here in previous topics in the code you sended me. Even the names of that forms are not existing maybe thhey all are derived from any other form but for eyamole there is no delegate called LinkUser_Click() in this project nor I can find solutionPanel_MouseHover ???
So please which form are you working on or if thhe project I got is not the actual one then pleease send that one, you really are working on
Re: [RESOLVED] iteration from the database
It is still the same, the only thing is that I have changed some names in it. This is the main project. Thanks.
Re: [RESOLVED] iteration from the database
Quote:
Originally Posted by
ken4ward
It is still the same, the only thing is that I have changed some names in it. This is the main project. Thanks.
Maybe, but I cannoz find even one line of code of what you are describing here