Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            //populate with data
            GridViewTextBoxColumn col = new GridViewTextBoxColumn("col");

            col.Width = 200;
            radGridView1.Columns.Add(col);

            for (int i = 0; i < 10; i++)
            {
                radGridView1.Rows.Add("Row " + i);
                radTreeView1.Nodes.Add("Node " + i);
            }

            //register the custom row behavior
            BaseGridBehavior gridBehavior = this.radGridView1.GridBehavior as BaseGridBehavior;

            gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
            gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new CustomGridDataRowBehavior());

            RadDragDropService dragDropService = radGridView1.GridViewElement.GetService <RadDragDropService>();

            dragDropService.PreviewDragStart += dragDropService_PreviewDragStart;
            dragDropService.PreviewDragOver  += dragDropService_PreviewDragOver;
            dragDropService.PreviewDragDrop  += dragDropService_PreviewDragDrop;
            dragDropService.PreviewDragHint  += dragDropService_PreviewDragHint;
            dragDropService.Stopped          += dragDropService_Stopped;
        }
Ejemplo n.º 2
0
        public RadForm1()
        {
            InitializeComponent();

            BindingList <Item> items = new BindingList <Item>();

            for (int i = 0; i < 5; i++)
            {
                items.Add(new Item(i, "Item" + i));
            }
            this.radGridView1.DataSource          = items;
            this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;

            //register the custom row behavior
            BaseGridBehavior gridBehavior = this.radGridView1.GridBehavior as BaseGridBehavior;

            gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
            gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new CustomGridDataRowBehavior());

            //handle drag and drop events for the grid through the DragDrop service
            RadDragDropService svc =
                this.radGridView1.GridViewElement.GetService <RadDragDropService>();

            svc.PreviewDragStart += svc_PreviewDragStart;
            svc.PreviewDragDrop  += svc_PreviewDragDrop;
            svc.PreviewDragOver  += svc_PreviewDragOver;
        }
Ejemplo n.º 3
0
        public FilteringIndicatorsForm()
        {
            InitializeComponent();

            this.radGridView1.CreateCell += RadGridView1_CreateCell;

            BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior;

            gridBehavior.UnregisterBehavior(typeof(GridViewFilteringRowInfo));
            gridBehavior.RegisterBehavior(typeof(GridViewFilteringRowInfo), new MyGridFilterRowBehavior());

            this.radGridView1.DataSource          = this.GetData();
            this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            this.radGridView1.EnableFiltering     = true;
        }