Populate Comboboxwith dependency of code product


Author
Message
Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
I have a Example !

Eu preciso population a comboBox1 com o valor da  textbox1. O Meu problema é que eu preciso fazer um Select * from ProjetoEquipamento where prj_nrow = value of textbox1         . Como population combobox whith Select ?

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Rafael,

I think that you are inadvertantly making a very simple task very complex.  As mentioned in previous posts, there are a lot of samples that show how to do this...and I know that other developers have tried to help you understand as well.  Maybe at this point you should just create a simple sample illustrating your problem and post it out here instead of all of these posts as this doesn't really seem to be going anywhere.  Maybe a real sample from YOUR perspective and then a correction via the forum posters will help you better undertstand where you are going wrong.

Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
yes, but my probleman is no this.

I modified my code for

        private void btnProjeto_Click(object sender, EventArgs e)
        {
            if (this.bdProjeto.ShowDialog() == DialogResult.OK)
            {
                prj_cod.Text = Convert.ToString(sysProjetoBO1.prj_cod);
                proj_eqp_nrow.Requery();
            }
        }
        private void proj_eqp_nrow_ListPopulating(MicroFour.StrataFrame.UI.ListPopulatingEventArgs e)
        {
            e.Parameters[0].Value = sysProjetoEquipamentoBO1.proj_eqp_nrow;
        }

In BO
        public void FillByProjetoEquipamentoGL(int nRowProjeto)
        {
            GoLiveGlobals.infoMessageBox(nRowProjeto.ToString());
            //this.FillDataTable("select * from tabproj_equipamento where prj_nrow = " + nRowProjeto);
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = String.Format("select * from tabproj_equipamento where prj_nrow = " + nRowProjeto, this.TableName);
            this.FillDataTable(cmd);
        }

In GoLiveGlobals.infoMessageBox(nRowProjeto.ToString()); return 0 ! Why ?


Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Rafael,

I noticed you have this code:

private void proj_eqp_nrow_ListPopulating(MicroFour.StrataFrame.UI.ListPopulatingEventArgs e)
{
e.Parameters[0].Value = prj_cod.Text;
}

But, your FillByProjetoEquipamentoGL(Int32) is expecting an Integer and the prj_cod.Text is string, so you have to make sure the value of the prj_cod.Text is an Integer, so you need to convert it using cint() or the equivalent C## function.

Edhy Rijo

Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
These images are of the same component combobox
I need value sysProjetoBO1.prj_nrow in Value Member for sysProjetoEquipamentoBO of the propierty PopulationDataSourceSettings. How make this ?

In Portuguese

Eu preciso do valor sysProjetoBO1.prj_nrow na Value member do  sysProjetoEquipamentoBO  da propriedade PopulationDataSourceSettings. Como eu faço isso ?

Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
I forgot myself to place the image of the configuration of combobox
Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
I tried to make equal in it I finish topic passed for the Ivan but he did not give certain

In BO

public void FillByProjetoEquipamentoGL(string nRowProjeto)
{
this.FillDataTable("SELECT * FROM "+ this.TableName);
}

in Form

private void proj_eqp_nrow_ListPopulating(MicroFour.StrataFrame.UI.ListPopulatingEventArgs e)
{
e.Parameters[0].Value = prj_cod.Text;
}
private void proj_eqp_nrow_Leave(object sender, EventArgs e)
{
this.proj_eqp_nrow.Requery();
}

What it is made a mistake?

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Rafael
Rafael
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 216
I searched in the forum but I did not obtain to develop. It could send me example code?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well I am not totally certain what you are trying to do.  But let's back up and start here.  First, all SF lists allow you to populate via a BO.  You will not want to just slap in SELECT code.  You will want to create a Fill command that accepts whatever parms that you need for population.

Second, you will want to set the combo being populated to populate Manual instead of FormLoad because you are going to want to first ensure that your dependent code is set.

Third, once you have created a Fill method and setup the PopulationDataSourceSettings to use that fill method on the Combo, then you will want to handle the ListPopulating event to provide the value from the dependent code.

Finally, there are a TON of samples on this.  This is an extremely common task done within the framework.  There are samples that come with the framework showing how to do this, you can look at the StrataFlix sample, or just search on the ListPopulating event within the forum and you will find a LOT of samples.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search