Skip to content

Replies

0
Adrian
Adrian answered on Jul 27, 2010 10:17 AM

Hi all

These seems only to work when using DataSource controls?

In our project I assigne directly a IList<UserDefinedDTO> to the DataSource of the WebDataGrid as in the following lines:

IList<MyUserDefinedDTO> myData = GetTheData();
MyWebDataGrid.DataSource = myData;

But when trying to cast back the row.DataItem

MyUserDefinedDTO data = (MyUserDefinedDTO)row.DataItem
an InvalidCastException is thrown (sorry for the german error message):

{"Das Objekt des Typs Infragistics.Web.UI.Framework.Data.DataRecord kann nicht in Typ MyUserDefinedDTO umgewandelt werden."}

Is it at all possible to cast back the row.DataItem in situations as described above?

Regards
Adrian

0
Adrian
Adrian answered on Jun 4, 2008 12:31 PM

Hi Matthew

Thank you very  much for this article! It's one of the better articles i have ever read about how to solve something special with UltraWebGrid!

Hope to read more such articles from you Matthew, for example how to synchronize values from Controls in TempaltedColumns with the underlying DataSource as this doesn't work automatically (by my actual understanding of the things about TemplatedColumns).

Adrian