1) Here is code that catches a mousedown event and tests to see if it is a right-click on a header. There is a FAQ (http://www.syncfusion.com/KB/Grid/Grid_c26c.asp#q547q) that uses a similar technique to display a context menu for any cell.
private void gridDataBoundGrid1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
Point clickPoint = gridDataBoundGrid1.PointToClient(Cursor.Position);
int rowIndex, colIndex;
gridDataBoundGrid1.PointToRowCol(clickPoint, out rowIndex, out colIndex);
if(rowIndex == 0 && colIndex > 0)
MessageBox.Show("gridDataBoundGrid1_MouseDown");
}
}
2) Look at the ControllerOptions property. You need to uncheck the OleDataSource and/or OleDataTarget flags.
3) The row headers are column 0. You can hide column 0 from code with
this.gridDataBoundGrid1.Model.HideCols[0] = true;
4) To autosize columnwidths or rowheights, you can use code such as
//autosize the colwidths of the col header (row 0)
this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Row(0));
You'll notice in the above code, we accessed properties in the Model member of GridDataBoundGridControl. If you are using the GridControl instead, you access these properties directly from GridControl, and do not have to use GridControl.Model.