Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I am working on a project that uses a datagrid I have a button to the right of my datagrid that I want to pull up and 'edit/detail' screen from the selected record the users have chosen. Is there an easy way to do this? I'm relatively new to .NET. Thanks in advance for all your comments!

On another note. Here is the code I'm using to populate my grid. I'm wondering if maybe I'm creating one total object (the grid itself) instead of objects in the grid (rows). This is also called in 'public mainWindow()'
private void FillDataGrid()
        {
            string ConString = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;
            string CmdString = string.Empty;
            using (SqlConnection con = new SqlConnection(ConString))
            {
                CmdString = "SELECT CJ96ORIG_AGCY, CJ96TCN, CJ96TCR, CJ96_STATUS, CJ96_FBI_NUM, CJ96NOTIFICATIONS_SENT FROM cj96TBRisc";
                SqlCommand cmd = new SqlCommand(CmdString, con);
                SqlDataAdapter sda = new SqlDataAdapter(cmd);
                DataTable dt = new DataTable("cj96");
                sda.Fill(dt);
                grdRISC.ItemsSource = dt.DefaultView;
            }
        }



Cheers!
Posted
Updated 14-Feb-14 9:50am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900