Hi everyone,
I'm trying to make a datagrid which allows custom components into cells. But when I call AddNew void, it gives me an error like this;
Constructor on type 'FCS.ManagementConsole.Main.Components.ucTextButtonElement' not found.
Here is my
Here is my component class;
Here is my ucGridViewTextBoxButtonColumn2.cs;
This the code that i get error;
Do you have any ideas?
I'm trying to make a datagrid which allows custom components into cells. But when I call AddNew void, it gives me an error like this;
Constructor on type 'FCS.ManagementConsole.Main.Components.ucTextButtonElement' not found.
Here is my
ucGridViewTextButtonCellElement.cs;using System;using System.Collections.Generic;using System.Linq;using System.Text;using Telerik.WinControls.UI;using Telerik.Reporting.Drawing;using System.Drawing;namespace FCS.ManagementConsole.Main.Components{ class ucGridViewTextButtonCellElement : GridDataCellElement { private ucTextButtonElement TextBoxButtonElement; public ucGridViewTextButtonCellElement(GridViewColumn column, GridRowElement row) : base(column, row) { } public override void Initialize(GridViewColumn column, GridRowElement row) { base.Initialize(column, row); } protected override Type ThemeEffectiveType { get { return typeof(GridDataCellElement); } } protected override void CreateChildElements() { base.CreateChildElements(); TextBoxButtonElement = new ucTextButtonElement(); TextBoxButtonElement.MinSize = new Size(50, 20); TextBoxButtonElement.Text = "Red"; this.Children.Add(TextBoxButtonElement); } }}Here is my component class;
using System;using System.Collections.Generic;using System.Linq;using System.Text;using Telerik.WinControls.UI;namespace FCS.ManagementConsole.Main.Components{ class ucTextButtonElement:RadTextBoxElement { public event EventHandler ButtonClick; public ucTextButtonElement() { RadButtonElement btn = new RadButtonElement(); btn.Size = new System.Drawing.Size(25, 10); btn.Click += new EventHandler(btn_Click); btn.BringToFront(); btn.Text = "..."; } void btn_Click(object sender, EventArgs e) { EventHandler handler = ButtonClick; if (handler != null) handler(this, e); } }}Here is my ucGridViewTextBoxButtonColumn2.cs;
using System;using System.Collections.Generic;using System.Linq;using System.Text;using Telerik.WinControls.UI;namespace FCS.ManagementConsole.Main.Components{ class ucGridViewTextBoxButtonColumn2 : GridViewDataColumn { public ucGridViewTextBoxButtonColumn2(string fieldName) : base(fieldName) { } public override Type GetCellType(GridViewRowInfo row) { if (row is GridViewDataRowInfo) { return typeof(ucTextButtonElement); } return base.GetCellType(row); } }}This the code that i get error;
ucGridViewTextBoxButtonColumn2 grid = new ucGridViewTextBoxButtonColumn2("TextBoxColumn"); radGridView1.Columns.Add(grid); radGridView1.Rows.AddNew();Do you have any ideas?
