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
How population combobox with dependency of code product.

Select * from Produto where code_product = textbox_code_product

Dustin Taylor
Dustin Taylor
StrataFrame Team Member (660 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
I'm not sure I understand the question... but I'll give it a shot Wink.



Are you trying to pull back all the records that match the selected value of your combo box?



MyBO.FillDataTable("SELECT * FROM Table WHERE code_product = " & cbo_Product.SelectedValue)


(I wouldn't recommend hard coding it in the FillDataTable like that, but it gives you a start)



Or are you trying to populate the combo box itself with all the records associated with a given code? If so, then just add a fill method to your BO that corresponds to your select statement, and call that method in your combo's PopulationDataSourceSettings.
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 use the code below
private void prj_cod_Leave(object sender, EventArgs e)

{

sysProjetoEquipamentoBO1.FillDataTable("SELECT * FROM tabproj_equipamento WHERE prj_nrow = " + sysProjetoBO1.prj_nrow);

}

but he did not give certain. I have a field sysProjetoBO1.prj_cod and sysProjetoBO1.prj_nrow in the same table. I need to show prj_cod and populate combobox for the code sysProjetoBO1.prj_nrow. Combobox populated is sysProjetoEquipamentoBO1.prj_nrow!

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.

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?
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 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?

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
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 ?

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

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