Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. DataGridView in Managed c++

DataGridView in Managed c++

Scheduled Pinned Locked Moved Managed C++/CLI
helpc++csswpfwcf
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VCsamir
    wrote on last edited by
    #1

    hi friends, i want to use datagridview in c++, i am using data binding. i add object list to binding and use this binding as data source to gridview. then i set the the dataPropertyName as the member of the object. my problem is i am not able to view my data in the grid. at runtime i want to add objects to the binding so that they can be viewed in the grid. my code is as below //bs is the binding object for(int j = 0; j< CustInfo.oCust->Customer->Count;j++) bs->Add(gcnew CustomerDetails(custobject)); CustGridView->DataSource = bs; DataGridViewColumn^ column1 = gcnew DataGridViewTextBoxColumn(); column1->DataPropertyName = "m_strName"; // member of CustomerDetails column1->Name = "Name"; column1->Width = 227; CustGridView->Columns->Add(column1); DataGridViewColumn^ column2 = gcnew DataGridViewTextBoxColumn(); column2->DataPropertyName = "m_strStreet"; //// member of CustomerDetails column2->Name = "Street"; column2->Width = 120; CustGridView->Columns->Add(column2); can any one help thanks in anticipation Regds Samir

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups