Home Forums WinForms controls Xceed Grid for WinForms CellEditor Property? Reply To: CellEditor Property?

User (Old forums)
Member
Post count: 23064

Tommy,

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:
<pre>
public class frmEnterInvoices : Form
{
public frmEnterInvoices()
{
InitializeComponent();
InitializeCellEditors();
}

private void InitializeCellEditors()
{
//Vendor Number MaxLength (5)
GridTextBox gtbVendorNumber = new GridTextBox();
gtbVendorNumber.MaxLength = 5;
dgInvoiceEntry.Columns[“colEntryVendorNumber”].CellEditor = gtbVendorNumber;
}
}
</pre>

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!

Thanks,
Bill

Imported from legacy forums. Posted by billmonti (had 434 views)