 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
 | Thanks  Fernando Hitch | 6:17 14 Jul '07 |
|
 |
Good work, it helps me a lot.
Thanks to the forum too.
The intelligence without action is nothing. Mario T.
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
I was asked to develop a similar control using AJAX in my previous Web project but wasn't sure how to approach the problem using AJAX to transer the dataset from server to the client. Good start .
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
|
 |
|
 |
Hi This was exactly i was looking for but is it possible for anybody to re-write it in vb.net.. i have no clue about C# and any other apart from vb.net.... Any help focus or is there any other way to do the same in vb.net...??.. Gurdeep
Plz email me at gurdeeptoor@yahoo.ie
Thanks in advance
|
| Sign In·View Thread·PermaLink | 2.20/5 |
|
|
|
 |
|
 |
Hi,
does anyone know how to modify this code to get the the columns to sort when I click on the column header?
|
| Sign In·View Thread·PermaLink | 2.33/5 |
|
|
|
 |
|
|
 |
|
 |
When I was using this control, I noticed some things 1. The row that was selected, was not returned. So we couldn't use any values from other columns Solution (CHANGES IN MultiColumnComboBox.cs) private void MultiColumnComboBox_AfterSelectEvent(object sender, DataRow drow){ try{ if(drow!=null){ this.SelectedRow = drow; this.Text = drow[displayMember].ToString(); } }catch(Exception exp){ MessageBox.Show(this,exp.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error); } } 2. There was no possibility to open the listview and select the row accordingly to the data in the combobox. Solution (CHANGES IN MultiColumnComboPopup.cs) /// /// Function that will select the row with the given value. /// /// Value to select in the listview /// Integer, containing the selected rownumber public int SetValue(string ItemToDisplay) { int intRow = -1; for(int i=0;i { if (lstvMyView.Items[i].Text.Trim() == ItemToDisplay.Trim()) { lstvMyView.Items[i].Selected=true; //lstvMyView.Items[i].EnsureVisible(); lstvMyView.Scrollable=true; lstvMyView.EnsureVisible(i); intRow = i; i = lstvMyView.Items.Count; } } return intRow; } Change private into public public System.Windows.Forms.ListView lstvMyView; (CHANGES IN MultiColumnComboBox.cs) protected override void OnDropDown(System.EventArgs e){ try { Form parent = this.FindForm(); if(this.dataTable != null || this.dataRows!= null) { MultiColumnComboPopup popup; if (this.Text == "" || this.Text == null) popup = new MultiColumnComboPopup(this.dataTable,ref this.selectedRow,columnsToDisplay); else { popup = new MultiColumnComboPopup(this.dataTable,ref this.selectedRow,columnsToDisplay,this.Text); } popup.AfterRowSelectEvent+=new AfterRowSelectEventHandler(MultiColumnComboBox_AfterSelectEvent); if (this.Name.ToString()=="cboStyle" || this.Name.ToString()=="cboFormat" || this.Name.ToString().IndexOf("Color")>0) // These controls are on a tabpage popup.Location=new Point(parent.Left + this.Left + 16, parent.Top + this.Bottom + this.Height + 190 + 22); else if (this.Name.ToString()=="cboPresentation") popup.Location=new Point(parent.Left + this.Left + 16 - 292 + this.Width, parent.Top + this.Bottom + this.Height ); else popup.Location=new Point(parent.Left + this.Left + 8 ,parent.Top + this.Bottom + this.Height); popup.Show(); if (popup.lstvMyView.SelectedIndices.Count > 0) popup.lstvMyView.EnsureVisible(popup.lstvMyView.SelectedIndices[0]);
if(AfterSelectEvent!=null) AfterSelectEvent(); } base.OnDropDown(e); } catch (Exception ex) { throw ex; } }
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
In order to position the popup I use the following code in the OnDropDown event method: popup.Location = this.PointToScreen (new Point(0,this.Height));
Anders Norell Software engineer, Sweden
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Sorry for my english
i dont't have access this page bat i think it is a not MultiColumnComboBox. Where a can find MultiColumComboBox control for add in the DataDridView
fank you
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
Hi,
Sorry for my english.
this Control is a greate work!
But have a problem when is into other objects (tab,groupbox,childform).
The problem is because the control use the x,y positions of the parent form.
I find a method to correct it (I Guess? ).
First. (using directive System.Runtime.InteropServices for using call API's ) Second.(Define a class with Calls to Api's in same namespace MyCustomControls.InheritedCombo)
using System.Runtime.InteropServices ;
namespace MyCustomControls.InheritedCombo { ... ... public class MultiColumnComboBox : System.Windows.Forms.ComboBox { ... }
public class Win32 { [DllImport("user32.dll")] public static extern bool GetWindowRect(int hWnd, ref RECT lpRect);
public struct RECT { public int Left; public int Top; public int Right; public int Bottom; } } }
Explain: The GetWindowRect function retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
Three. (Using the GetWindowRect() API )
protected override void OnDropDown(System.EventArgs e) { // Define a structure Win32.RECT xrec = new MyCustomControls.InheritedCombo.Win32.RECT();
// Using GetWindowRect with this.Handle (Combobox) as parent and // the structure create before to have the positions (x,y,x2,y2) Win32.GetWindowRect( (int) this.Handle, ref xrec );
// No use it //Form parent = this.FindForm(); if(this.dataTable != null || this.dataRows!= null) { MultiColumnComboPopup popup = new MultiColumnComboPopup(this.dataTable,ref this.selectedRow,columnsToDisplay); popup.AfterRowSelectEvent+=new AfterRowSelectEventHandler(MultiColumnComboBox_AfterSelectEvent); // No use it //popup.Location = new Point(parent.Left + this.Left + 4 ,parent.Top + this.Bottom + this.Height); // Now use the values of RECT structure for draw the popup popup.Location = new Point( xrec.Left, xrec.Bottom ) ; popup.Show(); if(popup.SelectedRow!=null) { try{ this.selectedRow = popup.SelectedRow; this.displayValue = popup.SelectedRow[this.displayMember].ToString(); this.Text = this.displayValue; } catch(Exception e2) { MessageBox.Show(e2.Message,"Error"); } } if(AfterSelectEvent!=null) AfterSelectEvent(); } base.OnDropDown(e); }
Explain: On the event OnDropDown create a var type RECT. Use the Function GetWindowRect for know the position of combobox. Use the values of structure for draw the listbox.
AGarcia Guatemala, C.A.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
The same fix may be obtained replacing the line
popup.Location = new Point(parent.Left + this.Left + 4 ,parent.Top + this.Bottom + this.Height);
with the following
popup.Location = this.PointToScreen(new Point(4, this.Height));
Cheers, Claudio Benghi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Has anyone solved the issue that when you click the dropdown the multi-column list appears as expected but you also get the standard dropdown list portion of the control flicking up and then disappearing???
Would be great if this flcking did not occur and the multi-column list simply appeared
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
The flicker will always show when overriding the OnDropDownEvent. To solve this you need to override the WndProc instead and catch the messages that ultimately will cause the OnDropDownEvent.
More information on how to do this can be found here: http://ilvyanyatka.spaces.live.com/blog/cns!EA0C02AB2E2FCFAC!198.entry
|
| Sign In·View Thread·PermaLink | 4.50/5 |
|
|
|
 |
|
 |
public MultiColumnComboBox(System.ComponentModel.IContainer container) { container.Add(this); InitializeComponent();
Type t = this.GetType().BaseType; FieldInfo tPropDropDownHeight = t.GetField("PropDropDownHeight", BindingFlags.NonPublic | BindingFlags.Static); if (tPropDropDownHeight == null) return; object propDropDownHeight = (int)tPropDropDownHeight.GetValue(this);
FieldInfo tProperties = t.BaseType.BaseType.GetField("propertyStore", BindingFlags.NonPublic | BindingFlags.Instance); object propertyStore = tProperties.GetValue(this); Type tPropertyStore = propertyStore.GetType(); MethodInfo setInteger = tPropertyStore.GetMethod("SetInteger", BindingFlags.Public | BindingFlags.Instance); setInteger.Invoke(propertyStore, new object[] { (Int32)propDropDownHeight, (Int32)0 }); }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I have problem with multipleColumnComboBox I can't "take" multComBox.ValueMember. I need to take multComBox.ValueMember and to show for example in one Label and when I change multColumnComboBox.DisplayMember atomatic to change the value in Label for multColumnComboBox.ValueMamber. Thank you!!

|
| Sign In·View Thread·PermaLink | 1.17/5 |
|
|
|
 |
|
 |
Does anyone know how to get back and set the value to Multi Column ComboBox ? It is possible use DataBindings.Add to bind to Multi Column ComboBox ? If yes, how to do ?
Thank you
|
| Sign In·View Thread·PermaLink | 2.92/5 |
|
|
|
 |
|
 |
hellow i need multy column DropDownlist in my web project my asp.net web project needs to a custom drop downlist with multy column please help me!
|
| Sign In·View Thread·PermaLink | 1.50/5 |
|
|
|
 |
|
|
 |