本文整理汇总了C#中Rock.Web.UI.Controls.GridReorderEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridReorderEventArgs类的具体用法?C# GridReorderEventArgs怎么用?C# GridReorderEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridReorderEventArgs类属于Rock.Web.UI.Controls命名空间,在下文中一共展示了GridReorderEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: gAttributes_Reorder
/// <summary>
/// Handles the Reorder event of the gAttributes control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void gAttributes_Reorder( object sender, GridReorderEventArgs e )
{
if ( ReorderAttributeClick != null )
{
var eventArg = new WorkflowActivityTypeAttributeEventArg( ActivityTypeGuid, e.OldIndex, e.NewIndex );
ReorderAttributeClick( this, eventArg );
}
}
示例2: gAttributes_GridReorder
/// <summary>
/// Handles the GridReorder event of the gAttributes control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void gAttributes_GridReorder( object sender, GridReorderEventArgs e )
{
ReorderAttributeList( AttributesState, e.OldIndex, e.NewIndex );
BindAttributesGrid();
}
示例3: gItemAttributes_GridReorder
/// <summary>
/// Handles the GridReorder event of the gItemAttributes control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void gItemAttributes_GridReorder( object sender, GridReorderEventArgs e )
{
var movedItem = ItemAttributesState.Where( a => a.Order == e.OldIndex ).FirstOrDefault();
if ( movedItem != null )
{
if ( e.NewIndex < e.OldIndex )
{
// Moved up
foreach ( var otherItem in ItemAttributesState.Where( a => a.Order < e.OldIndex && a.Order >= e.NewIndex ) )
{
otherItem.Order = otherItem.Order + 1;
}
}
else
{
// Moved Down
foreach ( var otherItem in ItemAttributesState.Where( a => a.Order > e.OldIndex && a.Order <= e.NewIndex ) )
{
otherItem.Order = otherItem.Order - 1;
}
}
movedItem.Order = e.NewIndex;
}
BindItemAttributesGrid();
}
示例4: rGrid_GridReorder
void rGrid_GridReorder( object sender, GridReorderEventArgs e )
{
int entityTypeId = iSecured.TypeId;
List<Rock.Model.Auth> rules = authService.GetAuths( iSecured.TypeId, iSecured.Id, CurrentAction ).ToList();
authService.Reorder( rules, e.OldIndex, e.NewIndex, CurrentPersonId );
Authorization.ReloadAction( iSecured.TypeId, iSecured.Id, CurrentAction );
BindGrid();
}
示例5: gFields_GridReorder
/// <summary>
/// Handles the GridReorder event of the gFields control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void gFields_GridReorder( object sender, GridReorderEventArgs e )
{
ParseControls();
if ( FormFieldsState.Any() )
{
var keyValue = FormFieldsState.First();
SortFields( keyValue.Value, e.OldIndex, e.NewIndex );
ReOrderFields( keyValue.Value );
}
BuildControls();
}
示例6: rGridBatch_GridReorder
/// <summary>
/// Handles the GridReorder event of the grdFinancialBatch control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
private void rGridBatch_GridReorder( object sender, GridReorderEventArgs e )
{
var batchService = new Rock.Model.FinancialBatchService();
var queryable = batchService.Queryable();
List<Rock.Model.FinancialBatch> items = queryable.ToList();
batchService.Reorder( items, e.OldIndex, e.NewIndex, CurrentPersonId );
BindGrid();
}
示例7: gGroupTypeRoles_GridReorder
/// <summary>
/// Handles the GridReorder event of the gGroupTypeRoles control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void gGroupTypeRoles_GridReorder( object sender, GridReorderEventArgs e )
{
ReorderGroupTypeRoleList( GroupTypeRolesState, e.OldIndex, e.NewIndex );
BindGroupTypeRolesGrid();
}
示例8: GridReorderEventArgs
/// <summary>
/// Raises the appropriate events for the <see cref="T:System.Web.UI.WebControls.GridView"/> control when it posts back to the server.
/// </summary>
/// <param name="eventArgument">The event argument from which to create a <see cref="T:System.Web.UI.WebControls.CommandEventArgs"/> for the event or events that are raised.</param>
void IPostBackEventHandler.RaisePostBackEvent( string eventArgument )
{
if ( eventArgument.StartsWith( "re-order:" ) )
{
string[] parms = eventArgument.Substring( 9 ).Split( ';' );
string dataKey = parms[0];
int oldIndex = 0;
if ( !int.TryParse( parms[1], out oldIndex ) )
{
oldIndex = 0;
}
int newIndex = 0;
if ( !int.TryParse( parms[2], out newIndex ) )
{
newIndex = 0;
}
int pageFactor = this.PageIndex * this.PageSize;
oldIndex += pageFactor;
newIndex += pageFactor;
GridReorderEventArgs args = new GridReorderEventArgs( dataKey, oldIndex, newIndex );
OnGridReorder( args );
}
else
{
base.RaisePostBackEvent( eventArgument );
}
}
示例9: rGridAccount_GridReorder
/// <summary>
/// Handles the GridReorder event of the rGridAccounts control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void rGridAccount_GridReorder( object sender, GridReorderEventArgs e )
{
var rockContext = new RockContext();
var accounts = GetAccounts( rockContext );
if ( accounts != null )
{
new FinancialAccountService( rockContext ).Reorder( accounts.ToList(), e.OldIndex, e.NewIndex );
rockContext.SaveChanges();
}
BindGrid();
}
示例10: rGrid_GridReorder
/// <summary>
/// Handles the GridReorder event of the rGrid control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void rGrid_GridReorder( object sender, GridReorderEventArgs e )
{
int entityTypeId = iSecured.TypeId;
var rockContext = new RockContext();
var authService = new Rock.Model.AuthService( rockContext );
List<Rock.Model.Auth> rules = authService.GetAuths( iSecured.TypeId, iSecured.Id, CurrentAction ).ToList();
authService.Reorder( rules, e.OldIndex, e.NewIndex );
rockContext.SaveChanges();
Authorization.ReloadAction( iSecured.TypeId, iSecured.Id, CurrentAction );
BindGrid();
}
示例11: OnGridReorder
/// <summary>
/// Raises the <see cref="E:GridReorder"/> event.
/// </summary>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected virtual void OnGridReorder( GridReorderEventArgs e )
{
if ( GridReorder != null )
{
GridReorder( this, e );
}
}
示例12: gMetricPartitions_GridReorder
/// <summary>
/// Handles the GridReorder event of the gMetricPartitions control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void gMetricPartitions_GridReorder( object sender, GridReorderEventArgs e )
{
ReorderMetricPartitionsList( MetricPartitionsState, e.OldIndex, e.NewIndex );
BindMetricPartitionsGrid();
}
示例13: gPageBlocks_GridReorder
/// <summary>
/// Handles the GridReorder event of the gPageBlocks control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void gPageBlocks_GridReorder( object sender, GridReorderEventArgs e )
{
int pageId = PageParameter( "EditPage" ).AsInteger();
Rock.Web.Cache.PageCache page = Rock.Web.Cache.PageCache.Read( pageId );
string zoneName = this.PageParameter( "ZoneName" );
var rockContext = new RockContext();
BlockService blockService = new BlockService( rockContext );
var blocks = blockService.GetByPageAndZone( page.Id, zoneName ).ToList();
blockService.Reorder( blocks, e.OldIndex, e.NewIndex );
rockContext.SaveChanges();
page.FlushBlocks();
BindGrids();
}
示例14: gGroupType_GridReorder
/// <summary>
/// Handles the GridReorder event of the gGroupType control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
protected void gGroupType_GridReorder( object sender, GridReorderEventArgs e )
{
var rockContext = new RockContext();
var groupTypes = GetGroupTypes( rockContext );
if ( groupTypes != null )
{
new GroupTypeService( rockContext ).Reorder( groupTypes.ToList(), e.OldIndex, e.NewIndex );
rockContext.SaveChanges();
}
BindGrid();
}
示例15: rGridSuggestion_GridReorder
/// <summary>
/// Handles the GridReorder event of the rGridSuggestion control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
void rGridSuggestion_GridReorder( object sender, GridReorderEventArgs e )
{
var rockContext = new RockContext();
var service = new FollowingSuggestionTypeService( rockContext );
var followingSuggestions = service.Queryable().OrderBy( i => i.Order ).ToList();
service.Reorder( followingSuggestions, e.OldIndex, e.NewIndex );
rockContext.SaveChanges();
BindGrid();
}