Capturing cell/button clicks in MultiColumnComboBox dropdown

Hi,

I have a PushButton in one column and regular data in other columns. I've set up 3 event handlers to capture the clicks on the buttons, but none of these fires. Why? 
  • (multiColumnComboBox1.ListControl as GridListControl).Grid.CellButtonClicked += CellButtonClicked;
  • (multiColumnComboBox1.ListBox as GridListBox).Grid.CellButtonClicked += CellButtonClicked;
  • (multiColumnComboBox1.ListControl as GridListControl).Grid.PushButtonClick += CellPushButtonClicked;

Thanks!

3 Replies

VR Vijayalakshmi Roopkumar Syncfusion Team February 7, 2018 10:27 AM UTC

Hi Tipal,

Thank you for the update.

To trigger the cell click event of MultiColumnComboBox, we would suggest you to raise the event manually on MouseUp event of the ListBox. Please refer the below code and modified sample:

Code[C#] 
//Event customization 
private void ListBox_MouseUp(object sender, MouseEventArgs e) 
{ 
GridControl gc = this.multiColumnComboBox1.ListBox.Grid; 
int rowIndex = 0, colIndex = 0; 
gc.PointToRowCol(e.Location, out rowIndex, out colIndex); 
//Raising CellClick event manually 
gc.RaiseCellClick(rowIndex, colIndex, e); 
} 
private void Grid_CellClick(object sender, GridCellClickEventArgs e) 
{ 
MessageBox.Show("Grid cell event clicked"); 
GridControl gc = this.multiColumnComboBox1.ListBox.Grid; 
GridStyleInfo style = gc[e.RowIndex, e.ColIndex]; 
if (style.CellType == GridCellTypeName.PushButton) 
{ 
//Code to customize 
} 
} 
 
 


The same has been modified in the below sample. Please refer it from below:

Sample: http://www.syncfusion.com/downloads/support/forum/135809/ze/MultiColumnComboBox-1584499732 

Please try this solution and let us know if it is helpful.


Regards
Vijayalakshmi V.R. 



T T February 7, 2018 12:45 PM UTC

This is very helpful, thank you very much!


VR Vijayalakshmi Roopkumar Syncfusion Team February 8, 2018 04:03 AM UTC

Hi Tipal

Thank you for the update.

Please let us know if you need any other assistance on this.

Regards
Vijayalakshmi V.R.

Loader.
Up arrow icon