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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How i can capture specific cell double click

Thread ID:

Created:

Updated:

Platform:

Replies:

59817 Apr 23,2007 04:34 PM UTC Jun 6,2007 02:54 PM UTC Windows Forms 9
loading
Tags: GridControl
Ashok
Asked On April 23, 2007 04:34 PM UTC

How i can capture specific cell double click

in sysncfusion.grid.groupig.cotrol

haneefm [Syncfusion]
Replied On April 23, 2007 04:48 PM UTC

Hi Ashok,

You can try handling the TableControlCurrentCellControlDoubleClick event for getting the mouse double in cell. It is only fires when the cell is in edit mode. Here is a code.

this.gridGroupingControl1.TableControlCurrentCellControlDoubleClick += new GridTableControlControlEventHandler(gridGroupingControl1_TableControlCurrentCellControlDoubleClick);

void gridGroupingControl1_TableControlCurrentCellControlDoubleClick(object sender, GridTableControlControlEventArgs e)
{
Console.WriteLine("For getting the Double in Current cell edit Mode");
}

For non edit mode , you cen get the the mouse double in cell using TableControlCellDoubleClick event.

this.gridGroupingControl1.TableControlCellDoubleClick += new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCellDoubleClick);

void gridGroupingControl1_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)
{
Console.WriteLine("For Non- Edit Mode");
}

Best regards,
Haneef

Chinedu
Replied On May 30, 2007 05:47 PM UTC

Thanks again Haneef,

How do I capture the value of a particular column in the row doubleclicked.

Each row has an ID column, when the row is doubleclicked, I want to get the Id value for that row.

Chinedu
Replied On May 30, 2007 06:49 PM UTC

Found it, used this method....

int RowIndex = e.TableControl.CurrentCell.RowIndex;
int ColIndex = 1;

Id = e.TableControl.Table.TableModel[RowIndex, ColIndex].CellValue.ToString()

Thanks for your help

haneefm [Syncfusion]
Replied On May 30, 2007 07:02 PM UTC

Hi Nedu,

You can try these code.

int RowIndex = e.TableControl.CurrentCell.RowIndex;
int ColIndex = e.TableControl.CurrentCell.ColIndex;
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(RowIndex,ColIndex);
string id = style.CellValue.ToString();

Best regards,
Haneef

Chinedu
Replied On June 1, 2007 02:07 PM UTC

Thanks Haneef,

what if the column has been moved by the user at runtime, please show how I can get to a named column at runtime.

haneefm [Syncfusion]
Replied On June 1, 2007 03:17 PM UTC

Hi Nedu,

You can get the draged column name using the e.Column property from GridQueryAllowDragColumnEventArgs in TableControlQueryAllowDragColumn event. Below is a code snippet

private void gridGroupingControl1_TableControlQueryAllowDragColumn(object sender, GridQueryAllowDragColumnEventArgs e)
{
Console.WriteLine( e.Column );
}

Best regards,
Haneef

Chinedu
Replied On June 3, 2007 03:43 PM UTC

Hey Haneef, Thanks for your help and time.

I believe you misunderstood my question.

I was asking about a situation where the columns have been moved around by the user. The ID_col column used to be column 1 and the user has moved it to position 9 or 10 or 20 in the grid.

now the user double-clicks a row. I want to be able to find the ID value held by the ID_col for that particular row whose cell was double clicked, The ID_col could now be at position 9 or 10 or 20 etc.

haneefm [Syncfusion]
Replied On June 4, 2007 09:52 PM UTC

Hi Nedu,

Sorry for the inconvenience caused. If you want to get the column value in a record, then you need to use the record.GetValue() method. Below is a code snippet that show this task.

int RowIndex = e.TableControl.CurrentCell.RowIndex;
int ColIndex = e.TableControl.CurrentCell.ColIndex;
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(RowIndex,ColIndex);

if( style != null && style.TableCellIndentity != null
&& style.TableCellIndentity.DisplayElement != null )
{
Record rec = style.TableCellIndentity.DisplayElement.GetRecord();
if( rec != null )
object obj = rec.GetValue("ID_col");
}

You can also get the underlying DataRow when you call record.GetData(). That will return the DataRowView element for the record.

Best regards,
Haneef

Chinedu
Replied On June 6, 2007 02:54 PM UTC

Thanks a million Haneef.

CONFIRMATION

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.

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

;