Skip to content

Commit

Permalink
Added extensibility point for GridView
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalTichy committed Jul 20, 2018
1 parent 75def8c commit bf0cd09
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/DotVVM.Framework/Controls/GridView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ protected internal override void OnPreRender(Hosting.IDotvvmRequestContext conte
DataBind(context); // TODO: support for observable collection
base.OnPreRender(context);
}
protected virtual void DataBind(IDotvvmRequestContext context)

private void DataBind(IDotvvmRequestContext context)
{
Children.Clear();
emptyDataContainer = null;
Expand All @@ -176,7 +176,8 @@ dataSource is ISortableGridViewDataSet sortableSet && sortableSet.SortingOptions
sortOptions.SortDescending = false;
}
(sortableSet as IPageableGridViewDataSet)?.GoToFirstPage();
} :
}
:
SortChanged;

// WORKAROUND: DataSource is null => don't throw exception
Expand All @@ -189,7 +190,6 @@ dataSource is ISortableGridViewDataSet sortableSet && sortableSet.SortingOptions

var header = CreateHeaderRow(context, sortCommand);
Children.Add(header);

var index = 0;
if (dataSource != null)
{
Expand Down Expand Up @@ -262,7 +262,7 @@ protected virtual HtmlGenericControl CreateHeaderRow(IDotvvmRequestContext conte
return head;
}

protected static void SetCellAttributes(GridViewColumn column, HtmlGenericControl cell, bool isHeaderCell)
private static void SetCellAttributes(GridViewColumn column, HtmlGenericControl cell, bool isHeaderCell)
{
if (!string.IsNullOrEmpty(column.Width))
{
Expand Down Expand Up @@ -291,7 +291,7 @@ protected static void SetCellAttributes(GridViewColumn column, HtmlGenericContro
}
}

protected virtual void CreateRowWithCells(Hosting.IDotvvmRequestContext context, DataItemContainer placeholder)
private void CreateRowWithCells(Hosting.IDotvvmRequestContext context, DataItemContainer placeholder)
{
var isInEditMode = false;
if (InlineEditing)
Expand Down Expand Up @@ -327,7 +327,7 @@ protected virtual void CreateRowWithCells(Hosting.IDotvvmRequestContext context,
}
}

protected virtual HtmlGenericControl CreateRow(DataItemContainer placeholder, bool isInEditMode)
private HtmlGenericControl CreateRow(DataItemContainer placeholder, bool isInEditMode)
{
var row = new HtmlGenericControl("tr");

Expand All @@ -346,7 +346,7 @@ protected virtual HtmlGenericControl CreateRow(DataItemContainer placeholder, bo
return row;
}

protected virtual bool IsEditedRow(DataItemContainer placeholder)
private bool IsEditedRow(DataItemContainer placeholder)
{
var primaryKeyPropertyName = ((IGridViewDataSet)DataSource).RowEditOptions.PrimaryKeyPropertyName;
if (string.IsNullOrEmpty(primaryKeyPropertyName))
Expand All @@ -369,7 +369,7 @@ protected virtual bool IsEditedRow(DataItemContainer placeholder)
return false;
}

protected virtual void CreateTemplates(Hosting.IDotvvmRequestContext context, DataItemContainer placeholder, bool isInEditMode = false)
private void CreateTemplates(Hosting.IDotvvmRequestContext context, DataItemContainer placeholder, bool isInEditMode = false)
{
var row = CreateRow(placeholder, isInEditMode);

Expand Down Expand Up @@ -496,7 +496,7 @@ protected override void AddAttributesToRender(IHtmlWriter writer, IDotvvmRequest
base.AddAttributesToRender(writer, context);
}



public override IEnumerable<DotvvmBindableObject> GetLogicalChildren()
{
Expand Down

0 comments on commit bf0cd09

Please sign in to comment.