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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Month Calendar Context Menu Problem

Thread ID:





45560 Jun 23,2006 09:21 AM UTC Jun 26,2006 03:09 AM UTC WinForms 2
Tags: GridControl
ks kee
Asked On June 23, 2006 09:21 AM UTC

i do a own context menu for month calendar. when it pop up , it will no focus on the point. How to move the selected date to the point? I try use coding below to get the row index and col index of the gridcontrol in monthcalendar. but it is no the date i click. ((GridControl)(control)).PointToRowCol(ClickPoint, out rowIndex, out colIndex); string dateSelect = ((GridControl)(control))[colIndex, rowIndex].CellValue.ToString(); free to ask me if cant get the idea. thanks in advance!


Administrator [Syncfusion]
Replied On June 23, 2006 06:23 PM UTC

Hi Ks, You need to set the location of the context menu in a CellMouseDown event of the grid control. Please find the code snippet here. //Here context menu show in cell (2,2) bool IsContextMenu = false; private void grid_CellMouseDown(object sender, GridCellMouseEventArgs e) { if(e.MouseEventArgs.Button == MouseButtons.Right) { GridControl grid = sender as GridControl; GridCurrentCell cc = grid.CurrentCell; Point pt = grid.GetCellRenderer(2,2).GetCellBoundsCore(2,2).Location; //Point pt1 = cc.Renderer.GetCellBoundsCore(cc.RowIndex,cc.ColIndex).Location; grid.ContextMenu = this.menu; this.menu.Show(grid, pt); IsContextMenu = true; e.Cancel = true; } else IsContextMenu = false; } private void mgrid_CellMouseUp(object sender, GridCellMouseEventArgs e) { if(e.MouseEventArgs.Button == MouseButtons.Right) e.Cancel = true; } Here is a sample. http://www.syncfusion.com/Support/user/uploads/DateTime value_fcaf7296.zip Let me know if this helps. Best Regards, Haneef

ks kee
Replied On June 26, 2006 03:09 AM UTC

Hi Haneef, i still fail to get the rowindex and colindex on the point i click, because the current cell still the previous one. then i put some coding in cellmousedown(success use this coding for databoundgrid before), it works :) int rowIndex, colIndex; Point ClickPoint = new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y); grid.PointToRowCol(ClickPoint, out rowIndex, out colIndex); thanks for your help!!!


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon