Pregunta

Estoy tratando de establecer un ComboBox.SelectedValue en una cadena que funciona, pero cuando su nulloRempty se equivoca. He probado el siguiente código en vano:

        if (string.IsNullOrEmpty(docRelComboBox.SelectedValue.ToString()))
        {
            document = "other";
        }

        else
        {
            document = docRelComboBox.SelectedValue.ToString();
        }

El Combobox es un dato, pero en teoría podría ser nullorempty en ciertas situaciones y necesito poder pasar el otro valor en esos tiempos. Cualquier ayuda sería genial.

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top