TreeView em WPF

.NET

26/03/2015

Estou tentando criar uma árvore no treeview mas depois de dois níveis já não da certo o xaml, alguém consegue me ajudar?
[img:descricao=erro]http://arquivo.devmedia.com.br/forum/imagem/396788-20150326-093456.png[/img]
Chayene Carmo

Chayene Carmo

Curtidas 0

Respostas

Randrade

Randrade

26/03/2015

Olá Chayene,

Se possível, poste o código junto com a imagem, para que possamos analisar melhor.
GOSTEI 0
Thiago Santana

Thiago Santana

26/03/2015

Chayene você está utilizando algum componente para montar o Treeview ou está tentando "fazer na mão" mesmo?
GOSTEI 0
Chayene Carmo

Chayene Carmo

26/03/2015

Sim, criei uma lista e ele está me resultando o retorno de uma consulta
GOSTEI 0
Chayene Carmo

Chayene Carmo

26/03/2015

public List<Unidade_Custo_BO> ListarFilhas(int id_sub_unidade)
{
List<Unidade_Custo_BO> lista_unidade_custo = new List<Unidade_Custo_BO>();
Centro_Custo_DAO ccDAO = new Centro_Custo_DAO();

using (_minhaConexao = new Conexao_DAO())
{
string select = "select id_unidade_custo, id_centro_custo, descricao, unidade_producao, id_sub_unidade, tipo_custo from tbl_unidade_custo where id_sub_unidade = " + id_sub_unidade.ToString();
OdbcDataReader reader = _minhaConexao.ExecutaLeitura_PostGres(select);
while (reader.Read())
{
Unidade_Custo_BO ucBO = new Unidade_Custo_BO();
ucBO.Id_Unidade_Custo = Convert.ToInt32(reader[0]);
ucBO.Centro_Custo = ccDAO.PegaIdCentroCusto(Convert.ToInt32(reader[1]));
ucBO.Descricao = reader[2].ToString();
ucBO.Unidade_Producao = reader[3].ToString();
ucBO.Id_Sub_Unidade = Convert.ToInt32(reader[4]);
ucBO.Tipo_Custo = (Tipo_Centro_Custo)Convert.ToInt32(reader[5]);
lista_unidade_custo.Add(ucBO);
}
reader.Dispose();
return lista_unidade_custo;
}
}
GOSTEI 0
POSTAR