How can I only update particular row in datagridview?

Apr 30 2020 6:48 AM
DataTable dt;
void fillQueryOption()
{
dt = Query.getData("Select * from askoptions order by id");
dgvAskOption.AutoGenerateColumns = false;
dgvAskOption.DataSource = dt;
clnOptID.DataPropertyName = "ID";
clnCode.DataPropertyName = "Code";
clnTitle.DataPropertyName = "title";
clnOptionName.DataPropertyName = "optionname";
}

private void btnOptSave_Click(object sender, EventArgs e)
{
askoptions_add_edit(txtOptID.Text, txtCode.Text, txtTitle.Text, cmbOptionName.Text);
MessageBox.Show("Record Save Successfully...!!!");
fillQueryOption();
}
when I save data fillQueryOption function update whole datagridview in c# it takes time and load on program.How can I only update particular row in datagridview.

Answers (5)