Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
Bind GridView.Data to a Dynamically created DataSet
posted

Hi - I'm having issues using your grid view when an object is being created dynamically. I've attached a sample project to illustrate exactly what I'm trying to do. 

Essentially I have some data that comes back and the grid columns will very. I'm able to create the columns dynamically without a problem but getting the data to bind to the grid properly is an issue. I've done this in the past but needed to use System.Dynamic or System.Reflection.Emit, both of which to my knowledge are not available in Xamarin Studio.

Take a look at the example and let me know what you think... (I can't seem to attach my zipped solution, I'll try in a reply)

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    To display the values in a particular cell, just access it through the column key:

    cSimpleGrid dataRow = (cSimpleGrid)dataSource.ResolveDataObjectForRow (path);

    cell.TextLabel.Text = dataRow [_fieldKey].ToString ();

    Hope this helps. 

    -SteveZ

Children
No Data