Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Two quick questions requiring two quick answers

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Two quick questions requiring two quick answers
Link Posted: 24-May-2006 19:36
1. C# how to make the whole grid read only I've seen a vb example but this does not seem to be valid, i.e., flyGrid1.Options ...

2. C# again, how to fire an event when a button column is clicked.

Help appreciated.
Link Posted: 24-May-2006 23:20

1. C# how to make the whole grid read only I've seen a vb example but this does not seem to be valid, i.e., flyGrid1.Options ...

[c#]
flyGrid.Options |= GridOptions.ReadOnly; //to make whole FlyGrid read only (lock editing)

flyGrid.Options &= ~GridOptions.ReadOnly; //to unlock editing


2. C# again, how to fire an event when a button column is clicked.

See the Xtras\\TaskManager sample that using ButtonColumns:
[C#]
//init Buttoncolumn
ButtonColumn startColumn = new ButtonColumn(\"Start\");
startColumn.ButtonImage = this.startBtn.Image;
startColumn.ButtonImageAlign = ContentAlignment.MiddleCenter;
startColumn.ButtonClick += new ButtonColumnClickHandler(startColumn_ButtonClick);

//ButtonClick handler
private void startColumn_ButtonClick(object sender, NodeBase node)
{
  TaskNode taskNode = node as TaskNode;//extract task node
  if (taskNode != null)
  {
    Task task = taskNode.Value as Task;//extrack Task object
    if (task != null && !task.Started)//if Task not started - start Task
      task.Start();        
  }
  ValidateThreadButtons(taskNode);//validate task buttons in clicked node
}