简体   繁体   中英

How to add multiple row's dynamically in DataGridTextColumn in wpf datagrid

  DataGridTextColumn col = new DataGridTextColumn();
  col.Header = "SMS_Message";
  Binding bind = new Binding();
  bind.Source = (I_Want_To_Bind_New_MSG_All_the_Time);
  col.Binding = bind;

GridView.Columns.Add(col);
  • I create column in datagrid Dynamically But now want to put different data on each row.
  • Above code I want to bind new Message on every row all the time, how this is possible.

Create proper class , object of which can be used as DataContext / ItemsSource .

If property types or number of properties changes, then use Anyonymous Object .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM