複数のチェックボックスを持つデータグリッドビューがあります。 Finishedチェックボックスをオンにすると、特定のテーブルを更新するためにlinqコードを実行する必要があります。その特定のチェックボックスが汚れているかどうか、そしてテーブルに渡す必要がある値を渡すためのコードをどこに書くのかを知るにはどうすればいいですか? datagridviewが基づいているのと同じテーブルではないことに注意してください。特定のチェックボックスが選択された後にコードを実行するには
ありがとうございました。
EDITは:
private void propertyInformationDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)propertyInformationDataGridView.Rows[e.RowIndex].Cells[3];
DataGridViewRow row = propertyInformationDataGridView.Rows[e.RowIndex] as DataGridViewRow;
System.Data.DataRowView SelectedRowView;
newCityCollectionDataSet.PropertyInformationRow SelectedRow;
SelectedRowView = (System.Data.DataRowView)propertyInformationBindingSource.Current;
SelectedRow = (newCityCollectionDataSet.PropertyInformationRow)SelectedRowView.Row;
if (Convert.ToBoolean(checkCell.EditedFormattedValue) == true)
{
DataClasses1DataContext dc = new DataClasses1DataContext();
var matchedCaseNumber = (from c in dc.GetTable<PropertyInformation>()
where c.CaseNumberKey == SelectedRow.CaseNumberKey
select c).SingleOrDefault();
reportsSent newReport = new reportsSent();
newReport.CaseNumberKey = SelectedRow.CaseNumberKey;
dc.reportsSents.InsertOnSubmit(newReport);
dc.SubmitChanges();
}
}
は、私はいくつかの点でendeditする必要がありますかの問題ということですか?
だから、正しい各行の "完成" のチェックボックスがありますか? – KreepN
あなたがコードについてのさらなる助けを必要としているかどうかを教えてください。私は終日ご利用いただけます。 – KreepN