Visual C# Developer Center > Visual C# Forums > Visual C# General > Dynamically changing DataGridView DataSource in C#
Ask a questionAsk a question
 

AnswerDynamically changing DataGridView DataSource in C#

  • Wednesday, November 04, 2009 11:40 PMoldSkule Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Using C# and a DataSet/BindingSource set up, I'm trying to dynamically change the DataSource between three views that are part of the DataSet.  This code will not work:

     

    this.vwAssignmentsAssignedDataGridView.Enabled = false;

     

    this.vwAssignmentsAssignedDataGridView.DataSource = "vwAssignmentsAssigned";

     

    this.vwAssignmentsAssignedDataGridView.Enabled = true;

    Can anybody offer a solution?  Thanks.

Answers

All Replies