Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public virtual BindingBase Binding
throw new InvalidOperationException("DataGridColumn doesn't support BindingMode.OneWayToSource. Use BindingMode.TwoWay instead.");
}

var path = compiled.Path.ToString();
var path = compiled.Path?.ToString();
if (!string.IsNullOrEmpty(path) && compiled.Mode == BindingMode.Default)
{
compiled.Mode = BindingMode.TwoWay;
Expand All @@ -76,7 +76,7 @@ public virtual BindingBase Binding
throw new InvalidOperationException("DataGridColumn doesn't support BindingMode.OneWayToSource. Use BindingMode.TwoWay instead.");
}

var path = reflection.Path.ToString();
var path = reflection.Path;
if (!string.IsNullOrEmpty(path) && reflection.Mode == BindingMode.Default)
{
reflection.Mode = BindingMode.TwoWay;
Expand Down Expand Up @@ -140,7 +140,7 @@ internal void SetHeaderFromBinding()
if (OwningGrid != null && OwningGrid.DataConnection.DataType != null
&& Header == null && Binding != null && Binding is BindingBase binding)
{
var path = (binding as Binding)?.Path ?? (binding as CompiledBindingExtension)?.Path.ToString();
var path = (binding as Binding)?.Path ?? (binding as CompiledBindingExtension)?.Path?.ToString();
if (!string.IsNullOrWhiteSpace(path))
{
var header = OwningGrid.DataConnection.DataType.GetDisplayName(path);
Expand Down