I used datagrid to show sql table datagrid.
And I showed one column on datagrid from sql.
Now I want to determine that which rows is now open & what is that values.
Like this.
And I used this code to show datatable on my datagrid.
string ConString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;
using (SqlConnection con = new SqlConnection(ConString))
{
SqlCommand cmd = new SqlCommand("SELECT roll FROM cmt_7th WHERE name IS Null And department IS Null And phone IS Null", con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable("cmt_7th");
sda.Fill(dt);
MydataGrid_roll.ItemsSource = dt.DefaultView;
}
And its show only row column. But I want to declare like my previous image.