Guest User

Untitled

a guest
Dec 14th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. void OnProcessUnboundColumnData(object sender, GridColumnDataEventArgs e)
  2. {
  3. IList itemsSource = (ItemsSource as IList);
  4. if (itemsSource == null) return;
  5. VerticalRowData row = Rows[e.ListSourceRowIndex];
  6. object item = itemsSource[Convert.ToInt32(e.Column.FieldName)];
  7. PropertyInfo itemProperty = item.GetType().GetProperty(row.RowName);
  8. if (itemProperty == null) return;
  9. if (e.IsGetData)
  10. {
  11. e.Value = itemProperty.GetValue(item, **null** );//!второй параметр вроде как необязательный, но без дописанного (,null) не работает
  12. }
  13. if (e.IsSetData)
  14. {
  15. itemProperty.SetValue(item, e.Value, **null** );//!третий параметр вроде как необязательный, но без дописанного (,,null) не работает
  16. }
  17. }
Add Comment
Please, Sign In to add comment