Question : Error loading parent combo box based on child combobox

I have two comboboxes menusubgroup and menugruop which is loaded during form load. First menusubgroup and then menugroup

At the same time, I am trying to filter mengroup combobox based on menusubgroupcombobox.

Now on form load, it goes to error because user has still not selected menusubgroup.

How do i over come this issue

private void Fillcmbmenugroupid()
        {
            try
            {
               
                var datasourcemenugroup = new EntityCollection(new MenugroupEntityFactory());
                filtermenusubgroup.Clear();
                filtermenusubgroup.Add(MenusubgroupFields.MenusubgroupId ==
                                       int.Parse(cmbmenusubgroupid.SelectedValue.ToString()));
                bucketmengroup.PredicateExpression.Add(filtermenusubgroup);
                bucketmengroup.Relations.Add(
                    MenugroupEntity.Relations.MenusubgroupEntityUsingMenugroupId);
                bucketmengroup.PredicateExpression.Add(MenugroupFields.Flag ==
                                                       StandardFlag.recordvalidflag);
                adaptermengroup.FetchEntityCollection(datasourcemenugroup, bucketmengroup, 0,
                                                      new SortExpression(
                                                          MenugroupFields.Description |
                                                          SortOperator.Ascending));
                cmbmenugroupid.DataSource = datasourcemenugroup;
                cmbmenugroupid.ValueMember = "MENUGROUPID";
                cmbmenugroupid.DisplayMember = "DECRIPTION";
                cmbmenugroupid.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                GlobalErrorHandler.LogMessage(ex.StackTrace);
            }
            finally
            {
                adaptermengroup.CloseConnection();
            }
        }

Answer : Error loading parent combo box based on child combobox

where does the  10.11.12.160 address come from?

point DNS to itself.
On the workstations leave them be the way they are on DHCP.

open up DNS
Administrative tools ->DNS
Click on the servername then right click it and go to properties.

Under the forwarders tab what do you have listed there?
Are you connected to a much larger network?  is that were the  10.11.12.160 comes from?
if not then add the open dns servers to the forwarders.  
Write down the others listed there just in case for some reason you need them.
Remove them (The can be added back if for some reason you need them)
If you are talking to another network segment you may need that 10.11.12.160 in there under the forwarders. To be safe you may want that one listed first. Just depends on your situation.
You can add that and both open dns servers. The OpenDNS servers can be backups. While 10.11.12.160 one being in the top position. If you want to take advantage of the open dns servers then you will need to remove it and register a opendns account for free.  As I said it depends on your situation though.  All should work if you do this.

Casey

Random Solutions  
 
programming4us programming4us