We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DropDownBarItem

Hi

I am using the DropDownBarItem to adding one comboxBox and Button ( Ok button) to PopupControlContainer of dropdownbaritem. I could able to list the combobox values but when I select any item from the list using mouse..the whole context menu disappers from the grid itself. In popupGridMenu_BeforePopup event i am binding the datasoure

I want to select the item from the dropdown list before pressing the Okay button.

Pls help.

protected DropDownBarItem textRangeDropDownBarItem;
protected PopupControlContainer popupControlContainerTextBox;
protected System.Windows.Forms.ComboBox cmbValue;

this.textRangeDropDownBarItem = new DropDownBarItem();
this.popupControlContainerTextBox = new PopupControlContainer();
this.btnTextRangeOk = new System.Windows.Forms.Button();
this.cmbValue = new ComboBox();


this.textRangeDropDownBarItem.PopupControlContainer = this.popupControlContainerTextBox; ///////


this.popupControlContainerTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.popupControlContainerTextBox.Controls.Add(this.btnTextRangeOk);
this.popupControlContainerTextBox.Controls.Add(this.rangeTextValue);
this.popupControlContainerTextBox.Controls.Add(this.rangeDoubleValue);
this.popupControlContainerTextBox.Controls.Add(this.cmbValue);
this.popupControlContainerTextBox.Location = new System.Drawing.Point(688, 40);
this.popupControlContainerTextBox.Name = "popupControlContainerTextBox";
this.popupControlContainerTextBox.Size = new System.Drawing.Size(136, 66);
this.popupControlContainerTextBox.TabIndex = 124;
this.popupControlContainerTextBox.TabStop = true;
this.m_editDropDownItem.Items.AddRange
(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { textRangeDropDownBarItem });


protected void popupGridMenu_BeforePopup(object sender, Syncfusion.Windows.Forms.CancelMouseEventArgs e)
{

rangeDoubleValue.Visible = false;
cmbValue.Visible = false;


int row = CurrentCell.RowIndex;
int col = CurrentCell.ColIndex;
bool doubleColSelected = false;
GridRangeInfoList list;
this.Selections.GetSelectedRanges(out list, true);

// Check if range has been selected
bool rangeSelected = ( list.Count > 0 );
string coltype = m_document.GetColType( col);
if (coltype.Equals(typeof(double).ToString()))
{
doubleColSelected = true;
}

// Check if multiple cols selected
bool multiColsSelected = false;
foreach(GridRangeInfo range in list)
{
int leftColIndex = range.Left;
int rightColIndex = range.Right;
if ( leftColIndex != rightColIndex )
{
multiColsSelected = true;
break;
}
}
if ( doubleColSelected
&& ( ! multiColsSelected ))
{
textRangeDropDownBarItem.Visible = true;
rangeDoubleValue.Visible = true;
cmbValue.Visible = true;
}
if(this[row, col].CellType == "ComboBox")
{
textRangeDropDownBarItem.Visible = true;
cmbValue.Visible = true;
cmbValue.DataSource = this[row, col].DataSource;
cmbValue.DisplayMember = this[row, col].DisplayMember;
cmbValue.ValueMember = this[row, col].ValueMember;
cmbValue.DropDownStyle = ComboBoxStyle.DropDownList;
}

}



Thanks
Ravi

1 Reply

MJ Mano J Syncfusion Team August 8, 2006 01:22 AM UTC

Hi Ravi,

This is a known shortcoming in popupControlContainer, i.e., Two popups opened at the same time cannot respond properly to mouse messages.

I will update you with more details shortly.

Regards,
Mano

Loader.
Live Chat Icon For mobile
Up arrow icon