DevEx.ComboBoxEdit if change another comboBoxEdit on some condition back to previous value


DevEx.ComboBoxEdit if change another comboBoxEdit on some condition...
Author
Message
Fabian R Silva, -
Fabian R Silva, -
Advanced StrataFrame User (869 reputation)Advanced StrataFrame User (869 reputation)Advanced StrataFrame User (869 reputation)Advanced StrataFrame User (869 reputation)Advanced StrataFrame User (869 reputation)Advanced StrataFrame User (869 reputation)Advanced StrataFrame User (869 reputation)Advanced StrataFrame User (869 reputation)Advanced StrataFrame User (869 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Hello, I have a problem with binding (I suppose)

I have ComboA and ComboB binded to a BO

When I change ComboA value, ComboB can change to another value

The problem is that if I change comboB value, comboA value change to the previus value

//when combo A (uxIdTipoContribuyente) change I have to change combo B (uxIdTipoDocumento) on some condition if needed

private void uxIdTipoContribuyente_SelectedValueChanged(object sender, EventArgs e)
{
    SetControlDocumento((int)uxIdTipoContribuyente.SelectedValue);
}

//if I have to change the comboB value, I call a method that change that value to an known value

private
 void SetControlDocumento(int idTipoContribuyente)
{
     // this says me if the comboA value have to change comboB value... 
     if (BO.Dic.TiposContribuyentesBO.EsCuitObligatorio(idTipoContribuyente)) { 
          //here I call a user control method that change his combobox control SelectedValue to an known value 
          documentoControl.SetTipoDocumento(TiposDocumentosEnum.CUIT); 
     }
}

// Documentcontrol is a inherited strataframe user control with a combo and a textbox... this method change the selected value of the combo

Documentcontrol.SetTipoDocumento (TiposDocumentosEnum tipoDocumentoId)
{
    uxIdTipoDocumento.SelectedValue = (int)tipoDocumentoId;
    //uxIdTipoDocumento.EditValue = tipoDocumentoId.ToString();
}
// The problem is that when SelectedValue on uxIdtipoDocumento is called, the BO's strataframe businesslayer call the event CurrentView_ListChanged that have this code:
If (Not Me._AreChangedEventsPaused)    Then loDelegate.Invoke(Me.GetPropertyDescriptor(e.PropertyDescriptor.Name), EventArgs.Empty) ...
// this code seems to refresh the value of the datasource and I loose the value that I setted on the combobox A
I have to do it at BO level? to do this I have to set BO's properties on BOM "Property changing events" to single for all / unique for each property and alter values here? or I have to control the "ChangedEventPaused"? (can I?) 
thanks in advance for the help that can bring to me on this problem

Edited 14 Years Ago by Fabian R Silva, -
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