Click here to Skip to main content
15,904,638 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
There is a control called nbText (which formats numbers) which inherits from DataGridViewAutoFilter.DataGridViewNumberBox.
How can I place this nbText control inside a datagridview (dgv) control in windows?

The following seems to compile but I am unable to add a number into the dgv textbox in the row.
C#
DataGridViewAutoFilter.DataGridViewNumberBox nbValue = new DataGridViewAutoFilter.DataGridViewNumberBox();            
            nbValue.Name = "nbCashValue";
            nbValue.HeaderText = "nbValue";
            nbValue.Width = 100;
            nbValue.DataPropertyName = "nbValue";

            dgv.Columns.Add(nbValue);


Everytime I add a value to that cell in the column of the dgv, the error is:
Object reference not set to an instance of an object.

How can I solve this error please?

Thanks
Posted
Updated 27-Sep-11 3:48am
v3

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900