Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

"Unable to cast object of type 'MS.Internal.NamedObject' to type 'Concept.UsergroupMasterDataSet'."

$
0
0

Hi,

I have a user control and when this user control is added to a form, I get the below error.

"Unable to cast object of type 'MS.Internal.NamedObject' to type  'Concept.UsergroupMasterDataSet'."

Below is my code for user control :



namespace Concept
{
    /// <summary>
    /// Interaction logic for usrctrlUsergroupMaster.xaml
    /// </summary>
    public partial class usrctrlUsergroupMaster : UserControl
    {
        Concept.UsergroupMasterDataSet usergroupmasterdataset;
        Concept.UsergroupMasterDataSetTableAdapters.UsergroupsTableAdapter usergroupmasterusergrouptableadapter;
        public usrctrlUsergroupMaster()
        {
            InitializeComponent();
            usergroupmasterdataset = ((Concept.UsergroupMasterDataSet)(this.FindResource("usergroupmasterdataset")));
            usergroupmasterusergrouptableadapter = new Concept.UsergroupMasterDataSetTableAdapters.UsergroupsTableAdapter();
        }

        private void ctrlUsergroupMaster_Loaded_1(object sender, RoutedEventArgs e)
        {            this.usergroupmasterusergrouptableadapter.Fill(this.usergroupmasterdataset.Usergroups);      
            System.Windows.Data.CollectionViewSource usergroupviewsource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("usergroupviewsource")));
            usergroupviewsource.View.MoveCurrentToFirst();
        }
    }
}


Viewing all articles
Browse latest Browse all 18858

Trending Articles



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