Dear all
1)I have created Group Table (grp_id,Grp_Name) where iam storing group like 'Nokia,Samsung' etc
2)then i have created Product Master(pid,ProductName,grp_id,rate)
In Product Master form i have use Displaymemeber & valuemember property of combo box which display Grp_Name & grp_id in combobox from Group Master table.
When iam saving data to Product Master, it save like this:
Pid ProductName grp_id rate
1 Nokia1100 1 1200
2 Nokia1000 1 1500
3 Samsung3500 2 2000
Till it is ok.
My problem occurs when displaying record.
It doesn't fectch groupNam on form. i know that iam not saving Groupname.
But can i show groupname in Combobox at the time of editing record Same as when i loading form.
Plz help me out!!!!!!!
Loading


Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 27, 2011, 11:51 AM EDT
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 27, 2011, 5:40 AM EDT
The question is not clear, do you want to show group name on the form than why dont you join the two tables and get the group name along with other details. Please if you can be more clear and specific in your requirements it will help us to try and provide some solution.
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Oct 27, 2011, 6:16 AM EDT
I have Product Master form where i have Group name as combobox. In this combobox iam showing GroupName using Displaymember property which iam fetching from Group Master.
At the time of saving the form data iam only saving groupid not the group name in database.
So at the time of editing record, how should i show groupname in combobox without join.
Plz revert back....
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 27, 2011, 9:36 AM EDT
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Oct 27, 2011, 9:44 AM EDT
it gives me null when i quickwatch the combobox bt in datareader it shows me the exact value.
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 27, 2011, 9:57 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Oct 27, 2011, 10:25 AM EDT
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Oct 27, 2011, 11:09 AM EDT
oDAL.Fill_Combo_Value_Display_ID(cmbGroupName, "Select grp_id,Grp_Name from tbl_Master_Group", "grp_id", "Grp_Name");
public void Fill_Combo_Value_Display_ID(ComboBox cmb, string Query,string Value,string Display)
I have use AddValue class For fetching values public class AddValue
Edit Record:
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Oct 27, 2011, 12:11 PM EDT
no result
@Suthish
No iam not using combobox in datagridview
Thanx
Suthish NairRank #92 · 22.8K reputationPosted Oct 28, 2011, 11:03 AM EDT
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Oct 28, 2011, 9:47 PM EDT
Javeed,
I have replaced selecteditem to selectedvalue. At that time it wasn't worked for mw.
Bt yesterday when i put debug to run code. The debug was not matching with that code. Then i have deleted the debug folder of my project. so it is working right now with same code only.
Thanx
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Oct 29, 2011, 12:09 AM EDT
Iam now using datagridview comboboxcell.
Here iam working with same scenario.
But here it is not showing name.
& how should i use Selectedvalue property of combobox same for Comboboxcell
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Oct 29, 2011, 12:58 AM EDT