Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

Checkbox, datagrid and populating a form? Need some Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry - 08 Dec 2004 18:55 GMT
//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());
Terry - 08 Dec 2004 19:21 GMT
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;

> //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,
[quoted text clipped - 19 lines]
> chkCageKeywatch.CheckState.Equals(grid[e.Row,19].ToString());
> chkAccountsPayable.CheckState.Equals(grid[e.Row,20].ToString());

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.