c# - Index Of Row To Copy Is Out Of Range -


ill start off code , explain problem.

 var customeraddresses = new custdeliveryaddresses();          // select columns         customeraddresses.query.columns.add(new column(custdeliveryaddress.field_description));         customeraddresses.query.columns.add(new column(custdeliveryaddress.field_postcode));          // filter customer.         customeraddresses.query.filters.add(new filter(custdeliveryaddress.field_customerdbkey, customerlookup.customer.slcustomeraccount));          // find         customeraddresses.find();           var addresses = custdeliveryaddress address in customeraddresses                         select new                         {                             address.description,                             address.postcode                         };          //customerdeliveryaddesses.autogeneratecolumns = false;         customerdeliveryaddesses.datasource = addresses.tolist(); 

so, when addresses.tolist() assigned datasource property of datagridview (customerdeliveryaddresses) error stating "index of row copy out of range" , cant life in me find out why.

please point me in right direction.

ok, feel little stupid now.

for reason had put code sets datasource null when selected index changes.

yeah know, why? answer is, dont know why did :p remove it, , ok


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -