Exemple #1
0
        /// <summary>
        /// Configure grid
        /// </summary>
        private void MarkersControl_Load(object sender, EventArgs e)
        {
            MarkersGrid.Configure(true, true);

            MarkersGrid.RootTable.Columns["Color"].ConfigureAsColor();
            MarkersGrid.RootTable.Columns["ExtraColor"].ConfigureAsColor(Color.Transparent);
        }
Exemple #2
0
        private void MarkersGrid_AddingRecord(object sender, CancelEventArgs e)
        {
            var currentRow = MarkersGrid.CurrentRow;

            if (currentRow != null && currentRow.RowType == RowType.NewRecord)
            {
                var marker = currentRow.DataRow as MarkerGridRow;
                if (marker != null)
                {
                    if (marker.IsValid())
                    {
                        UpdateMarker(marker, marker.GetMarkerSettings());
                    }
                    else
                    {
                        e.Cancel = true;
                        MarkersGrid.CancelCurrentEdit();
                    }
                }
            }
        }