Skip to content

TableView CellActivationKey - Right Click #2376

Answered by tznind
aaronhudon asked this question in Q&A
Discussion options

You must be logged in to vote

It might be easier to use the MouseClick event directly. For example

using Terminal.Gui;
using System.Data;

Application.Init();
var win = new Window("Example App (Ctrl+Q to quit)");

var dt = new DataTable();
dt.Columns.Add("Hey");
dt.Columns.Add("There");
dt.Columns.Add("Friend");

dt.Rows.Add("yay","woot","Fun!");
dt.Rows.Add("yay","wootttt","Fun!");
dt.Rows.Add("yay","woott","Fun!");
dt.Rows.Add("yay","woo","Fun!");

var tv = new TableView(dt){
    Width = Dim.Fill(),
    Height = Dim.Fill(),
};
tv.MouseClick += (e)=>
{
    if(e.MouseEvent.Flags == MouseFlags.Button3Clicked)
    {
        var clicked = tv.ScreenToCell(e.MouseEvent.X,e.MouseEvent.Y);
        if(clicked.HasValue && cli…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aaronhudon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants