| C1.Data.2 Assembly > C1.Data Namespace > C1DataRow Class : FromDataItem Method |
Objects obtained by bound controls from a C1DataObjects data source are not C1DataRow objects, although each of them corresponds to a C1DataRow object. The FromDataItem method represents this correspondence. Bound controls can get all information they need from the objects returned by the IList interface. However, if you want to work with such objects (data items) in code, get or set their field values, you need to treat them as C1DataRow objects. This method allows you to obtain a C1DataRow from an untyped row object (data item) returned by the IList interface. For example, C1WebGrid (bound grid control in ComponentOne Studio for ASP.NET) has a C1GridItem.DataItem property. This property returns an object obtained by the grid from the data source. It is not a C1DataRow object, so you must use C1DataRow.FromDataItem(C1GridItem.DataItem) to obtain the C1DataRow object corresponding to that data item.