I have a custom control "MyMaskedEditBox" which derives from "System.Windows.Forms.MaskedTextBox".
public class MyMaskedEditBox : System.Windows.Forms.MaskedTextBox { .... }
When i tried to Implement this control in UltraWinGrid, I got the error, "EditorControl property can only be set to a control that implements IProvidesEmbeddableEditor interface. at Infragistics.Win.UltraWinGrid.UltraGridColumn.set_EditorControl(Control value)".
I tried implementing as mentioned below.
MyMaskedEditBox EdtControl = new MyMaskedEditBox();
//Some Custom defined properties. EdtControl.DecimalPlaces = true;EdtControl.Mask = formatMask;EdtControl.Masked = MaskType.AlphaNumeric;EdtControl.Masklength = ((long)(0));EdtControl.PromptChar = ' ';EdtControl.Size = new System.Drawing.Size(100, 20);EdtControl.ToCase = Alphabetcase.ToUpperCase;
ultraGrid1.DisplayLayout.Bands[0].Columns[j].EditorControl = EdtControl;
I'm very new to use this UltrawinGrid and it will be really helpful if somebody let me how to do this?
Moreover, i found that there are multiple ways to add controls in ultrawingrid.
1. ultraGrid1.DisplayLayout.Bands[0].Columns[j].Style 2. Using EditorControl
What other ways to add controls and which one is the best usage as performance is concerned?
Thanks in Advance ..
There is no easy way to do this, since you need to implement the IProvidesEmbeddableEditor interface, as you have seen. There is an example of this with the RichTextEditor C# sample that ships with the NetAdvantage SDK, but I do not recommend that you go this route unless absolutely necessary. Why not use an UltraMaskedEdit control, or simply use an InputMask on the column itself. The Style property on the column allows you to select from a range of default editors so that you don't have to create your own, so this may be useful to you as well.
-Matt
Thanks for your reply Matt. i will look into RichTextEditor sample code but it will be really helpful for us if this feature can be implemented in Ultrawingrid in a more simplest way.
Hi,
I tried implementing as like in Richtext Editor and i successfully added myown MaskEditCustom control in the ultrawingrid. But the value i have entered will get disappeared when i try to edit the subsequent cells.
I want to know how to maintain the values in the cells when i tried to edit some other cells.
Please someone helpme on this.
Thanks in advance