Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationpageindexchanged Event not firingpageindexchanged Event not firing
Previous
 
Next
New Post
10/6/2010 6:57 AM
 

Hi ,

Iam using Dnngrid in my module which i have created dynamically .
I used paging for the grid but when i try to navigate other page in grid , my page is getting refreshed.
Please let me know if you have any idea.
Below is the code iam using.

namespace Philip.Modules.IspaceTimesheetDnn

{

public partial class Summary : PortalModuleBase

{

DotNetNuke.Web.UI.WebControls.DnnGrid dgDNNGrid = new DotNetNuke.Web.UI.WebControls.DnnGrid();

 

//override protected void OnInit(EventArgs e)

//{

// InitializeComponent();

// base.OnInit(e);

//}

//private void InitializeComponent()

//{

// this.Load += new System.EventHandler(this.Page_Load);

// dgDNNGrid.PageIndexChanged += new GridPageChangedEventHandler(dgDNNGrid_PageIndexChanged);

//}

protected void Page_Init(System.Object sender, System.EventArgs e)

{

dgDNNGrid.PageIndexChanged += new GridPageChangedEventHandler(dgDNNGrid_PageIndexChanged);

}

protected void Page_Load(System.Object sender, System.EventArgs e)

{

if (!IsPostBack)

{

BindData();

}

//dgDNNGrid.PageIndexChanged += new GridPageChangedEventHandler(dgDNNGrid_PageIndexChanged);

}

protected void btnGet_Click(object sender, EventArgs e)

{

BindData();

// dgDNNGrid.NeedDataSource += new GridNeedDataSourceEventHandler(dgDNNGrid_NeedDataSource);

 

}

protected void dgDNNGrid_PageIndexChanged(object source, GridPageChangedEventArgs e)

{

dgDNNGrid.DataSource = (DataTable)Session["DataSource"];

dgDNNGrid.CurrentPageIndex = e.NewPageIndex;

dgDNNGrid.DataBind();

}

protected void BindData()

{

DataTable dtgrid = Getdata();

//DotNetNuke.Web.UI.WebControls.DnnGrid dgDNNGrid = new DotNetNuke.Web.UI.WebControls.DnnGrid();

dgDNNGrid.AutoGenerateColumns = true;

dgDNNGrid.CellSpacing = 0;

dgDNNGrid.GridLines = GridLines.Both;

dgDNNGrid.FooterStyle.CssClass = "DataGrid_Footer";

dgDNNGrid.HeaderStyle.CssClass = "DataGrid_Header";

dgDNNGrid.ItemStyle.CssClass = "DataGrid_Item";

dgDNNGrid.AlternatingItemStyle.CssClass = "DataGrid_AlternatingItem";

dgDNNGrid.Width = Unit.Pixel(1000);

dgDNNGrid.Height = Unit.Pixel(400);

dgDNNGrid.DataSource = dtgrid;

dgDNNGrid.DataBind();

dgDNNGrid.ClientSettings.Scrolling.UseStaticHeaders = true;

dgDNNGrid.ClientSettings.Scrolling.AllowScroll = true;

dgDNNGrid.ClientSettings.Scrolling.FrozenColumnsCount = 2;

dgDNNGrid.ClientSettings.Scrolling.EnableVirtualScrollPaging = true;

dgDNNGrid.AllowSorting = true;

dgDNNGrid.AllowPaging = true;

dgDNNGrid.PageSize = 25;

dgDNNGrid.PagerStyle.AlwaysVisible = true;

dgDNNGrid.PagerStyle.Mode = GridPagerMode.NumericPages;

if (dtgrid.Rows.Count > 0)

{

dgDNNGrid.VirtualItemCount = dtgrid.Rows.Count - 1;

dgDNNGrid.MasterTableView.CommandItemSettings.ShowExportToExcelButton = true;

}

dgDNNGrid.EnableViewState = true;

for (int i = 0; i < dgDNNGrid.MasterTableView.AutoGeneratedColumns.Length; i++)

{

(dgDNNGrid.MasterTableView.AutoGeneratedColumns[i] as GridBoundColumn).DataFormatString = "<nobr>{0}</nobr>";

}

dgDNNGrid.Rebind();

Panel2.Controls.Add(dgDNNGrid);

//grdSummary.DataSource = dtgrid;

this.Session["DataSource"] = dgDNNGrid.DataSource;

// grdSummary.DataBind();

}


Thank in advance
Divya.

 
New Post
10/6/2010 12:46 PM
 
Do you happen to have caching turned on for the module in the module settings?

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
10/7/2010 3:40 AM
 
Thanks for the reply.
Yes I have set the value of Cache to 0 and also tried with -1 but still the event is not getting fired.

Thanks
Divya.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationpageindexchanged Event not firingpageindexchanged Event not firing


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out