|
-
Dec 8th, 2010, 05:42 AM
#1
Thread Starter
Frenzied Member
Multi-select Dropdown
Hey,
I understand you cannot use a dropdown list for multi select, however i have heard you can use one and when you select the drop down show a check list control within.
I cannot seem to find an example of this in action on here, is this possible the way I think, ideally I am trying to create a control which has the appearance of the parameter ones in reporting services.
-
Dec 8th, 2010, 06:14 AM
#2
Re: Multi-select Dropdown
This code should be able to be easily adapted to host a CheckedListBox in the drop-down:
http://www.codeguru.com/csharp/cshar...le.php/c15373/
-
Dec 8th, 2010, 08:50 AM
#3
Thread Starter
Frenzied Member
Re: Multi-select Dropdown
Ok thanks I have that working for the CheckedlistBox, my only issue is that I have it databound and as such when there are 100 rows in the list just expands, any ideas where I can set it to only be 10 items high with a vertical scroll if neecessary.
Code:
//
this.chkOnsiteCustomer.CloseComboDelegate = null;
this.chkOnsiteCustomer.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chkOnsiteCustomer.FormattingEnabled = true;
this.chkOnsiteCustomer.ItemHeight = 10;
this.chkOnsiteCustomer.Location = new System.Drawing.Point(159, 172);
this.chkOnsiteCustomer.Name = "chkOnsiteCustomer";
this.chkOnsiteCustomer.Size = new System.Drawing.Size(181, 60);
this.chkOnsiteCustomer.TabIndex = 0;
//
It seems to run this code but doesnt use the values when it displays the control.
public void LoadChildControl()
{
moTreeViewHost.Width = DropDownWidth;
moTreeViewHost.Height = DropDownHeight;
((Control)oChildControl).Width = DropDownWidth;
cmbDropDown.Show(this, 0, this.Height);
}
Last edited by FishGuy; Dec 8th, 2010 at 09:12 AM.
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
|