Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
555
How to add custom control (controls which derives from System.Windows.Forms) in Infragistics wingrid column?
posted

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 ..

Parents Reply Children
No Data