i can't update or refresh diagram


I have an example of a class diagram.

I consult the database and later I create the diagram for example (book, contains NRC, title), etc.
What I do is add data to the diagram but it is not reflected.


By clicking on "add property" I want you to update the diagram, Help.


my code is:

SqlDataAdapter adapter;
            SqlCommand comm;

            if (SelectType == 1)
            {
                comm = new SqlCommand("SELECT clase,atributo From Activity", con);   
            }
            else
            {
                comm = new SqlCommand("SELECT clase,atributo From Activity", con);               
            }
            adapter = new SqlDataAdapter(comm);
            System.Data.DataSet ds = new System.Data.DataSet("Table");           
            adapter.Fill(ds);

            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = new DataTable();
                dt = ds.Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ClassList classObj = new ClassList();
                    classObj.ClassName = dt.Rows[i]["clase"].ToString();
                    for (int j = i; j < dt.Rows.Count; j++)
                    {
                        if (dt.Rows[i]["clase"].ToString() == dt.Rows[j]["clase"].ToString())
                        {
                            if (!string.IsNullOrEmpty(dt.Rows[j]["atributo"].ToString()))
                            {
                                PropertyList propertyList = new PropertyList();
                                propertyList.PropertyName = dt.Rows[j]["atributo"].ToString();
                                classObj.PropertyList.Add(propertyList);
                            }
                            if (!string.IsNullOrEmpty(dt.Rows[j]["metodo"].ToString()))
                            {
                                MethodList methodList = new MethodList();
                                methodList.MethodName = dt.Rows[j]["metodo"].ToString();
                                classObj.MethodList.Add(methodList);
                            }
                        }
                        else
                        {
                            i = j - 1;
                            lstClass.Add(classObj);
                            break;
                        }
                        if (j == dt.Rows.Count - 1)
                        {
                            i = j;
                            lstClass.Add(classObj);
                            break;
                        }
                    }

                }
            }
            return lstClass;


but it does not work diagram.UpdateLayout();




1 Reply

RT Ramya Thirugnanam Syncfusion Team October 29, 2018 11:49 AM UTC

Hi Nancy, 
 
We have some clarification in creating the node in diagram. Could you please confirm whether creating the Node for each data source record or applying the databinding?  
If Node is created for each record of data source in your application, then new Node should be created for adding new property. This will be suitable when group is used to show the class diagram.  
 
Regards, 
Ramya T 


Loader.
Up arrow icon