Andy_Webster
asked on
DataGridPageChangedEventHandler not firing
The code below is used to create a datagrid at runtime.
I am adding event handlers to control Paging and editcommand however neither of the event handlers are firing
any ideas?
protected void loadGrids()
{
foreach(DataListItem Item in this.DataList1.Items){
//Create a new DataGrid object named QueuesDataGrid
DataGrid QueuesDataGrid = new DataGrid();
//Format the DataGrid to look cool.
QueuesDataGrid.BorderWidth
QueuesDataGrid.CellPadding
QueuesDataGrid.CellSpacing
QueuesDataGrid.GridLines = GridLines.Horizontal;
QueuesDataGrid.BorderColor
QueuesDataGrid.AllowPaging
QueuesDataGrid.PageSize = 6;
QueuesDataGrid.AllowSortin
QueuesDataGrid.ItemStyle.F
QueuesDataGrid.ItemStyle.F
//QueuesDataGrid.Alternati
QueuesDataGrid.ShowHeader = true;
QueuesDataGrid.HeaderStyle
QueuesDataGrid.HeaderStyle
QueuesDataGrid.HeaderStyle
QueuesDataGrid.HeaderStyle
//Do not autogenerate columns.
QueuesDataGrid.AutoGenerat
//****Add a series of BoundColumns****//
//***Payment Filename***//
BoundColumn bc = new BoundColumn();
ButtonColumn btnCol = new ButtonColumn();
//Set the BoundColumn Values
bc.HeaderText = "Filename";
bc.DataField = "fileName";
bc.ItemStyle.Wrap = false;
//Add the BoundColumn to the QueuesDataGrid.
QueuesDataGrid.Columns.Add
//***Priority***//
bc = new BoundColumn();
bc.HeaderText = "Priority";
bc.DataField = "priority";
//bc.DataFormatString="{0:
bc.ItemStyle.Wrap = false;
QueuesDataGrid.Columns.Add
//***Edit Button***///
btnCol = new ButtonColumn();
btnCol.CommandName = "Edit";
btnCol.Text = "Change Priority";
btnCol.CommandName = "Edit";
QueuesDataGrid.Columns.Add
//****End BoundColumns****//
//****Add Handlers****//
QueuesDataGrid.PageIndexCh
QueuesDataGrid.EditCommand
//Get the queue DataView filtered for the Type of payment
DataView _files = ((DataSet)this.Session["FI
_files.RowFilter = "type='" + ((Label)Item.FindControl("
//Bind the DataGrid.
QueuesDataGrid.DataSource = _files;
QueuesDataGrid.DataBind();
//Add the DataGrid to the Atlas collapsible panel.
Control x = Item.FindControl("Panel1")
x.Controls.Add(QueuesDataG
}
}
public void dg_PageIndexChanged(Object
{
((DataGrid)sender).Current
loadGrids();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Great!
ASKER