CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2000
    Posts
    110

    datagridview combobox binding

    Hi,
    I have a datagridview that is databound to a BindingSource containing objects of type MyCustomClass.

    MyCustomClass contains two Properties (Name, Class) and 1 dictionary, myUserDictionary<string,string>

    class MyCustomClass{

    string Name {get;set;}
    string Class {get;set;}
    Dictionary<string,string> myUserDictionary;

    }

    Is there a way to set a DataGridViewComboBoxColumn's DataPropertyName attribute to a specific <key,value> pair of myUserDictionary?

    This one has me stumped...

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: datagridview combobox binding

    the time it will take you to figure out , you'll wish you'd simply used a strongly typed datatable. it has all the features you seek if you make one column the primary key
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured