Inherit from DataGridViewTextBoxColumn

0
0

Hello,

I am trying to see if I can create an inherited control from the DataGridViewTextBoxColumn (so that I can have the functionalities already present in this for text handling), but in the “Add New Item” -> Wisej3 -> Inherited Control -> Type Picker I only see the following options (that start with DataGridView):

DataGridView

DataGridViewComboBoxEditingControl

DataGridViewDataTimePickerEditingControl

DataGridViewMaskedTextBoxEditingControl

DataGridViewNumericUpDownEditingControl

DataGridViewTextBoxEditingControl

DataGridViewTextBoxMultilineEditingControl

 

While I am able to derive from Wisej.Web.TextBox to create our own custom TextBox class and use it during design time, I can’t find a way to do the same for a TextBoxColumn. Is the TextBoxEditingControl = TextBoxColumn? When I use that, the custom column class does not show up for adding in the Columns Editor (see attached screenshot).

Attachment
  • You must to post comments
0
0

How did you derive it from DataGridViewTextBoxColumn? Did you manually do this? I am not able to choose DataGridViewTextBoxColumn in the Type Picker. When I manually create the public class it does show up, but when I am switching between designer mode and code mode, it keeps messing up the designer.cs file.

  • Alaa (ITG)
    Hi Aravind, Yes sometimes you’ll have to do it manually. Like my colleague Frank said, is your class declared public? Also, what do you mean by “it keeps messing up the designer.cs file” ?
  • Aravind Raam
    Yes, it is declared public. When I created the class manually (before I found that I have to use the New Item -> Wisej3 -> Inherited Control option to “inherit” properly a visual control), it seemed to work when I ran the code. But when I switched over to the design mode it gave me an error that I can’t seem to replicate now. Maybe will keep an eye on this and post if and when I see that error. It was similar to the errors that you get when viewing the designers in WinForms for custom controls and it suddenly doesn’t recognize the control anymore.
  • You must to post comments
0
0

Hi Aravind,

I just tried here deriving from DataGridViewTextBoxColumn and it showed up in the Column Editor immediately.

Is your class declared as public? If it is please share some code so we check it.

Best regards
Frank

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.