MKItani
asked on
datagridview+datatable+event in C#
hi all,
I am using C#+window application.
my code is as follow:
datagridview1.datasource=d ataTable1;
What is the names of the events that i can use to write my code before add new row add after add a new row to the datagridview during the binding source.
I am using C#+window application.
my code is as follow:
datagridview1.datasource=d
What is the names of the events that i can use to write my code before add new row add after add a new row to the datagridview during the binding source.
ASKER
the link is failed. it is the link of the task and not for msdn.
Please checked
Please checked
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is what I do
if (Whatever the condition)
{
SqlConnection con = new SqlConnection("user id=user;" +
"password=pass;server=127.0.0.0;" +
"Trusted_Connection=yes;" +
"database=db; " +
"connection timeout=30");
// Retrieving data from Stored Proceedure and bind it to datagrid
try
{
con.Open();
SqlCommand com = new SqlCommand("spx_storedProcName", con);
com.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adapter = new SqlDataAdapter(com);
DataTable tbl = new DataTable();
adapter.Fill(tbl);
DataGrid1.DataSource = tbl;
DataGrid1.DataBind();
Response.Write(DataGrid1.Columns[1].ToString());
}
catch (Exception ex)
{
Response.Write(ex.Message);
con.Close();
}
}
ASKER
failed
refer to following MSDN link for more details :
https://www.experts-exchange.com/questions/26900450/datagridview-datatable-event-in-C.html