Home › Forums › WinForms controls › Xceed Grid for WinForms › c# – DoubleClick event on XceedGrid
-
AuthorPosts
-
#13621 |
Well, I have posted about this in the pass about double clicking in the Xceed Grid’s rows to trigger a double click event. I got a few answers, unfortunately I could not made any of them to work except putting the following line of code into the “SelectedRowsChanged” event:
myGrid_SelectedRowsChanged(object sender, System.EventArgs e)
{foreach(Xceed.Grid.Cell cell in lvwDB.DataRows[index].Cells) cell.DoubleClick += new EventHandler(CellDoubleClick);
}This works but with some side effects…
I got this suggestion from C# user:
//place this in a init method…
foreach( Xceed.Grid.DataRow row in gridControl1.DataRows)
{
row.DoubleClick += new EventHandler(row_DoubleClick);
}private void row_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show(“row_DoubleClick”);
}and from Tommy user…
// init method
myGridControl.DataRowTemplate.DoubleClick += new EventHandler(row_DoubleClick);private void row_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show(“row_DoubleClick”);
}unfortunately none of them work… my double clicks on the grid do nothing so, I’m still wondering what am I doing WRONG!
My code is this:
public f_t_ListChoose()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
[b]lvwDB.DataRowTemplate.DoubleClick += new EventHandler(row_DoubleClick);[/b]
//
// TODO: Add any constructor code after InitializeComponent call
//
}And I created the:
private void row_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show(“bla”);
}I truly hope someone can help me…
Imported from legacy forums. Posted by EFileTahi-A (had 4293 views)
See this recent thread: <a href=”http://www.xceedsoft.com/Forums/ShowPost.aspx?PostID=2661″>http://www.xceedsoft.com/Forums/ShowPost.aspx?PostID=2661</a>
Imported from legacy forums. Posted by Tommy (had 136 views)
Hi, Tommy, thanks for posting once more….
Where shall I put this code?:
foreach(Xceed.Grid.Cell cell in _grid.DataRowTemplate.Cells)
{
cell.DoubleClick += new EventHandler( Cell_DoubleClick );
}Imported from legacy forums. Posted by EFileTahi-A (had 501 views)
Right after you create the grid.
If you use the Windows Forms Designer, a good place would be in the constructor of your Form, right after the call to InitializeComponent.Imported from legacy forums. Posted by Tommy (had 140 views)
I put it like you said:
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
foreach(Xceed.Grid.Cell cell in lvwDB.DataRowTemplate.Cells)
{
cell.DoubleClick += new EventHandler(Cell_DoubleClick);
}//
// TODO: Add any constructor code after InitializeComponent call
//
}And it does not work…. the Cell_DoubleClick function is never called….
Why the f*ck dont this work?!? Am truly getting tired of Xceed!
What I’m I missing for God sake!?Imported from legacy forums. Posted by EFileTahi-A (had 376 views)
Anyone?
Imported from legacy forums. Posted by EFileTahi-A (had 5043 views)
-
AuthorPosts
- You must be logged in to reply to this topic.