X
xanthviper
Pardon my ignorance here for I really can't find a direct answer to my
question concerning the DataGridView.
I have a Winform with a DataGridView on it. Its datasource is a
DataView. Life works great with the grid. I am able to sort, move
columns, and edit cells by clicking on the cell and making the change.
How do I update the changes to my DataView when I make a change to a
cell within the grid? I'm sure there is an easy answer to this and I
truly think i'm just having one of those days. Hopefully someone may
be able to point me in the right direction.
I am using .NET 2.0 and C#.
I appreciate your time.
Regards,
-Charlie
My Code Setup:
DataTable criteriaData;
private void SiteChooserControl_Load(object sender, System.EventArgs e)
{
criteriaData = subject.SiteSelectionCriteriaDataTable; //DataTable
gridSource = new DataView(criteriaData);
gridSource.AllowNew = false;
gridSource.AllowEdit = true;
gridSource.Sort = "SteNme";
AddHandlers();
this.grdSites.DataSource = gridSource;
}
protected void AddHandlers()
{
criteriaData.RowChanged += new
DataRowChangeEventHandler(criteriaData_RowChanged);
criteriaData.ColumnChanged += new
DataColumnChangeEventHandler(Criteria_ColumnChanged);
}
question concerning the DataGridView.
I have a Winform with a DataGridView on it. Its datasource is a
DataView. Life works great with the grid. I am able to sort, move
columns, and edit cells by clicking on the cell and making the change.
How do I update the changes to my DataView when I make a change to a
cell within the grid? I'm sure there is an easy answer to this and I
truly think i'm just having one of those days. Hopefully someone may
be able to point me in the right direction.
I am using .NET 2.0 and C#.
I appreciate your time.
Regards,
-Charlie
My Code Setup:
DataTable criteriaData;
private void SiteChooserControl_Load(object sender, System.EventArgs e)
{
criteriaData = subject.SiteSelectionCriteriaDataTable; //DataTable
gridSource = new DataView(criteriaData);
gridSource.AllowNew = false;
gridSource.AllowEdit = true;
gridSource.Sort = "SteNme";
AddHandlers();
this.grdSites.DataSource = gridSource;
}
protected void AddHandlers()
{
criteriaData.RowChanged += new
DataRowChangeEventHandler(criteriaData_RowChanged);
criteriaData.ColumnChanged += new
DataColumnChangeEventHandler(Criteria_ColumnChanged);
}