c# - How do I bind a datagrid in Silverlight? -
i new silverlight.
how bind datagrid in silverlight project?
the app has 1 mainpage.xaml user control. datagrid located in mainpage.xaml user control. list of objects retrieved in mainpage.
how should go databinding list of objects datagrid?
is there other way bind this?
there 3 alternatives:
- databinding using xaml syntax
- databind in code behind
- setting itemssource property of datagrid instance in code behind
for alternative 1 can idea reading following post:
http://odetocode.com/code/740.aspxfor alternative 2 take on following link:
http://blogs.msdn.com/b/scmorris/archive/2008/04/14/defining-silverlight-datagrid-columns-at-runtime.aspxalternative 3 quick way things working. following link contains simple one:
https://docs.google.com/doc?docid=0aqnzlafqzooazgzrc25ty3bfmwhzmno3c2c4&hl=enmany don't consider alternative 2 , 3 best practice , suggest go take on mvvm (modelview-viewmodel) approach.
Comments
Post a Comment