Thanks for your quick response. I was excited to implement the CellEditors in my project. Unfortunately, this solution isn’t working for me.
Here’s what I’m doing, as per your example:
public class frmEnterInvoices : Form
private void InitializeCellEditors()
//Vendor Number MaxLength (5)
GridTextBox gtbVendorNumber = new GridTextBox();
gtbVendorNumber.MaxLength = 5;
dgInvoiceEntry.Columns[“colEntryVendorNumber”].CellEditor = gtbVendorNumber;
However, I’m getting the following error:
An unhandled exception of type ‘System.NullReferenceException’ occurred in [app].exe
Additional information: Object reference not set to an instance of an object.
…in the line where I assign the CellEditor to the Column. It seems as if the GridControl hasn’t rendered yet, so it doesn’t know what the Column is (even though this code is called after the InitializeComponent function, which creates the GridControl and all Columns).
If you have any additional ideas, I’d love to hear them!
Imported from legacy forums. Posted by billmonti (had 434 views)