Click here to Skip to main content
16,020,182 members
Home / Discussions / C#
   

C#

 
GeneralRe: While physically possible Pin
joshp121713-Jul-06 9:16
joshp121713-Jul-06 9:16 
QuestionDecoding SNMP Data Pin
MrEyes13-Jul-06 7:51
MrEyes13-Jul-06 7:51 
QuestionHow I can Read this File in C# Pin
mm31013-Jul-06 7:38
mm31013-Jul-06 7:38 
AnswerRe: How I can Read this File in C# Pin
Not Active13-Jul-06 7:43
mentorNot Active13-Jul-06 7:43 
AnswerRe: How I can Read this File in C# Pin
stancrm13-Jul-06 8:32
stancrm13-Jul-06 8:32 
GeneralRe: How I can Read this File in C# Pin
Dave Kreskowiak13-Jul-06 9:02
mveDave Kreskowiak13-Jul-06 9:02 
QuestionHow to drag and drop datagrid cells? Pin
Kenneth Mora Flores13-Jul-06 7:34
Kenneth Mora Flores13-Jul-06 7:34 
QuestionBinding Combobox to related tables ! Pin
User 209307313-Jul-06 6:48
User 209307313-Jul-06 6:48 
Dear friends...

There are 3 tables in my database which 2 of them are related as parent and child. And here are the columns:
Parent Table: ParentCode int(PK), ParentName nvarchar(256)
Child Table: ChildCode int(PK), ChildName nvarchar(256), ParentCode int(FK)
3rd Table(MyTable): SerialNumber int(PK), Name nvarchar(256), Parent int, Child int

These 3 tables are loaded into a dataset with the specified relation named 'ParentChild'.I want to store SelectedValue of comboboxes into the 'MyTable'. Two comboboxes are placed on my form with following bindings:

comboBoxParent.DataSource = dataSet;<br />
comboBoxParent.DisplayMember = "Parent.ParentName";<br />
comboBoxParent.ValueMember = "Parent.ParentCode";<br />
comboBoxParent.DataBindings.Add("SelectedValue",dataSet.Tables["MyTable"],"Parent");<br />
<br />
comboBoxChild.DataSource = dataSet;<br />
comboBoxChild.DisplayMember = "Parent.ParentChild.ChildName";<br />
comboBoxChild.ValueMember = "Parent.ParentChild.ChildCode";<br />
comboBoxChild.DataBindings.Add("SelectedValue",dataSet.Tables["MyTable"],"Child");


Note that there is no relation between MyTable and other two tables (Parent and Child).
When SelectedIndex of the parent combo is changed, child combo changes respectively but SelectedIndexChanged, SelectedValueChanged, ... of the child combo doesn't fire! SelectedValue of the child combo is changing but due to events stoppage the underlying datasource can't be aware of changes and doesn't update itself. When I press the update button or I change the bindingsource position the SelectedValue of child combo becomes null.
On Update button click I write the following code :

this.BindingContext[dataSet.Tables["MyTable"]].EndCurrentEdit();<br />
myDataAdapter.Fill();


Please guide me ! I think this is a bug of List controls or data binding of .NET ! Mad | :mad:

[ _ Always there is another way _ ]
QuestionHow to modified text file in C Pin
arun.m13-Jul-06 6:02
arun.m13-Jul-06 6:02 
AnswerRe: How to modified text file in C Pin
Christian Graus13-Jul-06 6:03
protectorChristian Graus13-Jul-06 6:03 
QuestionLosing value of object Pin
leckey13-Jul-06 5:54
leckey13-Jul-06 5:54 
AnswerRe: Losing value of object Pin
Christian Graus13-Jul-06 6:02
protectorChristian Graus13-Jul-06 6:02 
GeneralRe: Losing value of object Pin
leckey13-Jul-06 6:05
leckey13-Jul-06 6:05 
AnswerRe: Losing value of object Pin
Guffa13-Jul-06 9:04
Guffa13-Jul-06 9:04 
GeneralRe: Losing value of object Pin
leckey13-Jul-06 9:57
leckey13-Jul-06 9:57 
AnswerRe: Losing value of object Pin
Guffa13-Jul-06 11:55
Guffa13-Jul-06 11:55 
AnswerRe: Losing value of object Pin
Josh Smith13-Jul-06 6:06
Josh Smith13-Jul-06 6:06 
GeneralRe: Losing value of object Pin
leckey13-Jul-06 6:11
leckey13-Jul-06 6:11 
GeneralRe: Losing value of object Pin
Josh Smith13-Jul-06 7:44
Josh Smith13-Jul-06 7:44 
QuestionHow to implement Trees ... Pin
JamesT113-Jul-06 5:38
JamesT113-Jul-06 5:38 
AnswerRe: How to implement Trees ... Pin
Christian Graus13-Jul-06 5:45
protectorChristian Graus13-Jul-06 5:45 
GeneralRe: How to implement Trees ... Pin
Josh Smith13-Jul-06 5:50
Josh Smith13-Jul-06 5:50 
GeneralRe: How to implement Trees ... Pin
Christian Graus13-Jul-06 5:53
protectorChristian Graus13-Jul-06 5:53 
GeneralRe: How to implement Trees ... Pin
Josh Smith13-Jul-06 5:59
Josh Smith13-Jul-06 5:59 
GeneralRe: How to implement Trees ... Pin
led mike13-Jul-06 7:28
led mike13-Jul-06 7:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.