Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

the objects added to a list of bindingsource must have all of the same type -System.InvalidOperationException

$
0
0

the objects added to a list of bindingsource must have all of the same type -System.InvalidOperationException

i am using a datagrid

this.bindingSourcelotesprog.DataSource = _context.Lots.Where

the datagrid has values from diferent  tables with lamda i can get all this values

now i want to add a new row to the grid

and i am using Lots_Grelha as the type

should i must Lots to add a new item?

            bindingSourcelotesprog.Add(new Lots_Grelha
            {

               article_reference="",

               article_name =cmbArtigo.Text,

                 other ="",

            });

        public class Lotes_Grelha
        {
            public string article_reference{ get; set; }
            public string article_name{ get; set; }
            public string other { get; set; }

        }


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>