-
September 25th, 2013, 12:21 PM
#1
combobox to 'show all' when checkbox is true
I have this code in place where a combobox will show 'Codes' where codes = 'Y' and status = 'A' from a database. There is a checkbox that says 'show all' and when it is checked, it should show all codes where the status = 'A' and not matter if the code is 'Y'. (some codes = 'N') But it is not working. Can anyone see why it is not working? This is the only code i have in place for this checkbox.
Code:
if (Combobox.Checked == true)
{
Datatable= Main.SQLQuery_ReturnDS("Select Code Display, 2 from Code_Support where Status = 'A' Union All Select '', 1 ORDER BY Code").Tables[0];
DataColumn[] CodekeyColumn = new DataColumn[1];
CodekeyColumn[0] = Datatable.Columns[0];
Code.DataSource = Datatable;
Code.DisplayMember = "Display";
Code.ValueMember = "Display";
}
else
{
Datatable= Main.SQLQuery_ReturnDS("Select Code Display, 2 from Code_Support where Code = 'Y' and Status = 'A' Union All Select '', 1 ORDER BY DOSCode").Tables[0];
DataColumn[] CodekeyColumn = new DataColumn[1];
CodekeyColumn[0] = Datatable.Columns[0];
Code.DataSource = Datatable;
Code.DisplayMember = "Display";
Code.ValueMember = "Display";
}
-
September 26th, 2013, 04:41 PM
#2
Re: combobox to 'show all' when checkbox is true
How does this code get called?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|