This project is read-only.

Add an attribute column to a featureset.

Aug 28, 2014 at 7:18 PM
Edited Aug 28, 2014 at 9:13 PM
Hi every one.
I am going to create a featureset and add some attribute to it,I used this code to create datatable and add column to it and then edit them.there is no errors in that.but when I try to show datatable to a gridview it is empty.Can you help me find my mistake?
 result.DataTable = new DataTable();
                            //result.DataTable.Columns.Add(new DataColumn("کد بهره بردار", typeof(int)));
                            result.Projection = DotSpatial.Projections.ProjectionInfo.FromEpsgCode(Properties.Settings.Default.UTMCode);
                            result.Features[0].DataRow.Table.Columns.Add(new DataColumn("کد بهره بردار", typeof(int)));
                            foreach (var fe in result.Features)
                               // fe.DataRow.Table.Columns.Add(new DataColumn("کد بهره بردار", typeof(int)));
                                fe.DataRow[0] = ownerID;
here is code that I use to show table in gride view
 dataGridView1.DataSource = Fset.DataTable;
I managed to solve it.Problem was with setting datasource,I have to clean it before set a new datasource.
Marked as answer by jany_ on 9/11/2014 at 12:37 PM