Grid Events

FlexGrid provides many events which you can use to customize almost every aspect of the control's behavior. You can see a complete list in the Online Documentation.

These events can be grouped into categories that include:

  • Mouse: FlexGrid relies on HTML events for mouse handling, and includes a hitTest method that can be used to determine which part of the grid the event refers to.
  • Selection: The selectionChanging and selectionChanged events can be used to prevent users from selecting parts of the grid or to display information relative to the current selection.
  • Editing: FlexGrid provides events that can be used for preventing certain cells from being edited (beginningEdit), for customizing the editor element (prepareCellForEdit), for validation (cellEditEnding), and more.
  • Resizing Rows and Columns: FlexGrid raises events when rows and columns are being resized so that you can validate or persist the grid layout.
  • Reordering Columns: FlexGrid raises events when rows and columns are being dragged into new positions so that you can validate or persist the grid layout.
  • Drag and Drop: FlexGrid uses HTML drag/drop events for reordering rows and columns, and you can extend that support to provide cell drag and drop functionality as well.
1
2
3
4
5
6
7
8
9
10
11
12
13
using System.Web.Mvc;
 
namespace LearnMvcClient.Controllers
{
    public partial class C1FlexGridController : Controller
    {
        // GET: Events
        public ActionResult Events()
        {
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<h1>
    @Html.Raw(Resources.C1FlexGrid.Events_Title)
</h1>
<p>
    @Html.Raw(Resources.C1FlexGrid.Events_Text1)
</p>
<p>
    @Html.Raw(Resources.C1FlexGrid.Events_Text2)
</p>
<ul>
    <li>
        @Html.Raw(Resources.C1FlexGrid.Events_Text3)
    </li>
    <li>
        @Html.Raw(Resources.C1FlexGrid.Events_Text4)
    </li>
    <li>
        @Html.Raw(Resources.C1FlexGrid.Events_Text5)
    </li>
    <li>
        @Html.Raw(Resources.C1FlexGrid.Events_Text6)
    </li>
    <li>
        @Html.Raw(Resources.C1FlexGrid.Events_Text7)
    </li>
    <li>
        @Html.Raw(Resources.C1FlexGrid.Events_Text8)
    </li>
</ul>