Getting Raw Field Values From SPListItem Or SPDataSourceViewResultItem

This method is helpful when you are working with the two different types, SPDataSourceViewResultItem providing custom type information:

[csharp]

 public object GetRawFieldValue(SPListItem item)
        {
            object fieldValue = null;
            if (item != null)
            {
                SPField fieldByInternalName = item.Fields.GetFieldByInternalName(InternalName);
                if (fieldByInternalName != null)
                {
                    fieldValue = item[fieldByInternalName.Title];
                }
            }
            return fieldValue;
        }

        public object GetRawFieldValue(T item)
        {
            object rawFieldValue = null;
            if (item is SPListItem)
            {
                SPListItem listItem = item as SPListItem;
                return GetRawFieldValue(listItem);
            }
            if (item is SPDataSourceViewResultItem)
            {
                SPDataSourceViewResultItem dataSourceViewResultItem = item as SPDataSourceViewResultItem;
                rawFieldValue = GetRawFieldValue(dataSourceViewResultItem);
            }
            return rawFieldValue;
        }

        public object GetRawFieldValue(SPDataSourceViewResultItem item)
        {
            object rawFieldValue = null;
            SPListItem spListItem = item.ResultItem as SPListItem;
            if (spListItem != null)
            {
                rawFieldValue = GetRawFieldValue(spListItem);
            }
            return rawFieldValue;
        }

[/csharp]

Share

SPWorkflowDataSourceView

Description The Microsoft.SharePoint.WebControls.SPWorkflowDataSourceView sealed class inherits from System.Web.UI.DataSourceView, which serves as the base class for derived data source view classes. In the case of the SPWorkFlowDataSourceView class, the DataSource is of type Microsoft.SharePoint.WebControls.SPWorkflowDataSource

This Post Details Content That I Have Written Regarding The SharePoint API On MSDN. The Full Article Will Have These Contents As Annotations Of The Full Article.

I Encourage You To Read The Full MSDN Class Documentation, Since Things Like Type Hierarchy Are Illustrated.

Adam Buenz’s MSDN Located At Annotations edited by Adam Buenz – MVP:

Description The Microsoft.SharePoint.WebControls.SPWorkflowDataSourceView sealed class inherits from System.Web.UI.DataSourceView, which serves as the base class for derived data source view classes. In the case of the SPWorkFlowDataSourceView class, the DataSource is of type Microsoft.SharePoint.WebControls.SPWorkflowDataSource

Read My Complete MSDN Article: SPWorkflowDataSourceView

Share

TableResultControl

Description The Microsoft.SharePoint.WebControls.TableResultControl class inherits from the Microsoft.SharePoint.WebControls.PickerResultControlBase class which provides functionality for EntityEditorWithPicker contsruction facilitating the searching of arbitrary data. Class heavily related to the use of this control are the Microsoft.SharePoint.WebControls.EntityEditorWithPicker class, the Microsoft.SharePoint.WebControls.PickerDialog class, and Microsoft.SharePoint.WebControls.SimpleQueryCont

This Post Details Content That I Have Written Regarding The SharePoint API On MSDN. The Full Article Will Have These Contents As Annotations Of The Full Article.

I Encourage You To Read The Full MSDN Class Documentation, Since Things Like Type Hierarchy Are Illustrated.

Adam Buenz’s MSDN Located At Annotations edited by Adam Buenz – MVP:

Description The Microsoft.SharePoint.WebControls.TableResultControl class inherits from the Microsoft.SharePoint.WebControls.PickerResultControlBase class which provides functionality for EntityEditorWithPicker contsruction facilitating the searching of arbitrary data. Class heavily related to the use of this control are the Microsoft.SharePoint.WebControls.EntityEditorWithPicker class, the Microsoft.SharePoint.WebControls.PickerDialog class, and Microsoft.SharePoint.WebControls.SimpleQueryCont

Read My Complete MSDN Article: TableResultControl

Share