Checkbox, datagrid and populating a form? Need some Help

G

Guest

//this passes (DataGrid, Row user selected, and DataSet) from another form
which has the datagrid, the user selects the row in which they need to edit,
this row will populate a form. I am able to populate every textbox but for
some reason I can not get the CheckState to work for me. Is there something
I'm missing here?
Thank you.
Terry
//the code!
private void Handler_Row(object sender,RequestAdmin.CustomRowEventArgs e)
{
DataSet dSet = e.DSet;
DataGrid grid = e.Grid;
int row = e.Row;

//this works.
txtFirstName.Text = grid[e.Row,0].ToString();
txtLastName.Text = grid[e.Row,1].ToString();
..........
//THIS IS THE ISSUE! Will Not grab the value from the Datagrid.
chkDartManager.CheckState.Equals(grid[e.Row,17].ToString());
chkInfoGenesis.CheckState.Equals(grid[e.Row,18].ToString());
chkCageKeywatch.CheckState.Equals(grid[e.Row,19].ToString());
chkAccountsPayable.CheckState.Equals(grid[e.Row,20].ToString());
 
G

Guest

I figured it out, just incase someone else needs the Answer Here it is:
Had to convert it to a bool from SqlDbType.bit

bool ACWBool = (bool) grid[e.Row, 16];
chkAcresWizard.Checked = ACWBool;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top