Techie Talks

Tuesday, July 25, 2006

Mapping a business object onto a Windows Forms DataGridViewComboBoxCell

Well, after about two weeks of fighting to solve this issue, I found a solution today.

Issue: Mapping a business object onto a Windows Forms DataGridViewComboBoxCell.

The crux of the issue arises from the fact that a DataGridViewComboBoxCell doesn't have a SelectedItem property.

Solution: Got it from here.

Overview: Add a proprety to the business object that refers to itself, and map it to the DataGridViewComboBoxCell's Value property.

E.g:

public class Dimension
{

    ...
    ...

    public Dimension Self
    { return this; }

   ...
   ...

}


1 Comments:

Blogger Ashish Waghray said...

wow! i am mesmerized! :) how are u doing buddy!

3:19 PM  

Post a Comment

<< Home