[Solved] Designer vs Coding input type of a DataGridViewTextBoxColumn

Answered
0
0

I am trying to change the input type of a textbox column in code

Dim col = New DataGridViewTextBoxColumn With {
.Name = team.Abbreviation,
.ToolTipText = team.Name,
.Tag = team.ID,
.InputType.Type = TextBoxType.Number,
.Width = 50}

But it errors out stating type is not a member of DataGridViewTextBoxColumn?

  • You must to post comments
Best Answer
0
0

The compiler error says that you need an object reference  to refer to Type. https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0120

Use col.InputType.Type = .TextBoxType.Number

Wisej is a .NET library, doesn’t change the standard VB.NET or C# syntax and compilers.

 

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.