I want to add all the row to a datatable and then assign it to gridview.. I have not used datatable. Please guide
The code is as below:
else if (e.CommandName == "AddContactPerson")
{
Control control=null;
if(GVContact.FooterRow!=null)
{
control=GVContact.FooterRow;
}
else
{
control=GVContact.Controls[0].Controls[0];
}
string contactstatus = null;
CheckBox chk = (control.FindControl("chkstatus") as CheckBox);
if (chk.Checked)
{
contactstatus = "1";
}
else
{
contactstatus = "0";
}
string contact = (control.FindControl("txtcontact") as TextBox).Text;
string contactemail = (control.FindControl("txtCemail") as TextBox).Text;
string contactmobile = (control.FindControl("txtCmobile") as TextBox).Text;
Here i want to create a DataTable and assign the DataTable to GVContact I want to Assign the columns: contact ,contactemail ,contactmobile ,contactstatus to the DataRow
}