 |
|
 |
Hi, How i have solve the problem of reset the current page index, when i m doing pagination with query string and suppose i select page number 3 and now i m searching data and search data get results 5 records,so if pagination is position 3 then this does not show any result because of page will be reset to position 3.and page size id defined 10 records per page,so this does not show any record in page number 3. please solve my problem as soon as possible.
|
|
|
|
 |
|
 |
I'm using Collectionpager to paging for a datalist.
When I was not checking IsPostBack in PageLoad events, collectionpager still works fine.
But ImageLinkButton error: Invalid postback or callback argument.
When I use (! IsPostBack) to fix, ImageLinkButton worked, but collectionpager not display data when I click on another page.
This is my code:
protected void Page_Load (object sender, EventArgs e)
{
if (! IsPostBack)
try
{
DataSet ds = new DataSet ();
if (Session ["Timkiem"] == null)
{
string connString =
/ / Create SQL query
string sql = "SELECT [MaSP], [MaNSX], [MaModel], [MaloaiSP], [MaBH], [TenSP], [Giaban], [HinhSP] FROM [SanPham] WHERE ([MaNSX] = 'NSX01') ";
/ / Create a connection
SqlConnection conn = new SqlConnection (connString);
/ / Create Adapter
SqlDataAdapter da = new SqlDataAdapter ();
da.SelectCommand = new SqlCommand (sql, conn);
/ / Create and fill DataSet
da.Fill (ds, "SanPham");
btXoaKQtimkiem.Visible = false;
}
else
{
ds = (DataSet) Session ["Timkiem"];
lblTitle.Text = "PRODUCTS FOUND";
btXoaKQtimkiem.Visible = true;
}
if (ds.Tables [0]. Columns.Contains ("HienthiGia"))
ds.Tables [0]. Columns.Remove ("HienthiGia");
ds.Tables [0]. Columns.Add (new DataColumn ("HienthiGia", typeof (string)));
for (int i = 0; i <ds.Tables [0]. Rows.Count; i + +)
{
int giaban = int.Parse (ds.Tables [0]. Rows [i] ["Giaban"]. ToString ());
cgia string = String.Format ("{0: N2}", giaban);
ds.Tables [0]. Rows [i] ["HienthiGia"] = cgia;
}
CollectionPager1.MaxPages = 10000;
CollectionPager1.PageSize = 9 / / number of items displayed per page
CollectionPager1.DataSource = ds.Tables [0]. Defaultview;
CollectionPager1.BindToControl = dtlDanhsachSP;
dtlDanhsachSP.DataSource = CollectionPager1.DataSourcePaged;
dtlDanhsachSP.DataBind ();
}
catch
{
}
}
picture when I have not used (! IsPostBack)
picture when I have used (! IsPostBack)
Thank for many help!
Sorry about my English!
|
|
|
|
 |
|
 |
can you provide the code to attach my SqlDataSource to collection pager instead of DataSet?
|
|
|
|
 |
|
 |
Hi could someone please help with the paging mode of PostBack.
When the paging mode is set to postback and you click next..the next set of result does not get displayed!
Please help!
Thank you!
|
|
|
|
 |
|
 |
Sir, your control is great but how can i save the saerch criteria for every page?
Regards;
Help people,so poeple can help you.
|
|
|
|
 |
|
 |
Hi, I am getting no result when using this code on button click..
protected void Button1_Click(object sender, EventArgs e)
{
DataSet SampleDataSet = SampleData();
//Set DataSource of Pager to Sample Data
CollectionPager1.DataSource = SampleDataSet.Tables[0].DefaultView;
//Let the Pager know what Control it needs to DataBind during the PreRender
CollectionPager1.BindToControl = Repeater1;
//Set the DataSource of the Repeater to the PagedData coming from the Pager.
Repeater1.DataSource = CollectionPager1.DataSourcePaged;
}
please suggest me what to go
|
|
|
|
 |
|
 |
This control just work when is not postback.
|
|
|
|
 |
|
 |
Hi,
I using CollectionPager to Paging my DataList.
The problem is, inside datalist I have a button(Add to Cart), when click this button it will a event button click. But, when apply CollectionPager this Button can not work. This is my code
protected void dtlProduct_ItemCreated(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
LinkButton _buttonAdd = (LinkButton)e.Item.FindControl("btnAddToCart");
if (_buttonAdd != null)
{
_buttonAdd.Click += new EventHandler(buttonAdd_Click);
_buttonAdd.CommandArgument = e.Item.ItemIndex.ToString();
}
}
}
protected void dtlProduct_ItemCommand(object source, DataListCommandEventArgs e)
{
dtlProduct.SelectedIndex = e.Item.ItemIndex;
}
private void buttonAdd_Click(object sender, EventArgs e)
{
}
Event Button add never occcur when I use collectionPager.
I'm very appreciate
Thank you.
|
|
|
|
 |
|
 |
Same Problem With I m getting no result when using this code in button...
protected void Button1_Click(object sender, EventArgs e)
{
DataSet SampleDataSet = SampleData();
//Set DataSource of Pager to Sample Data
CollectionPager1.DataSource = SampleDataSet.Tables[0].DefaultView;
//Let the Pager know what Control it needs to DataBind during the PreRender
CollectionPager1.BindToControl = Repeater1;
//Set the DataSource of the Repeater to the PagedData coming from the Pager.
Repeater1.DataSource = CollectionPager1.DataSourcePaged;
}
Please Help Me
Thanks Rkumar670@gmail.com
|
|
|
|
 |
|
 |
Only the first 3 entries in the search results listed, does not appear CollectionPager.
I added project only 1 texbox and 1 button
Please help for problem!
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BindData()
{
MySqlConnection cnn = new MySqlConnection(ConfigurationManager.ConnectionStrings["string"].ConnectionString);
MySqlCommand cmd = new MySqlCommand("SELECT * FROM news WHERE Headline like '%" + this.txtSearch.Text + "%'", cnn);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
cnn.Open();
CollectionPager1.DataSource = dt.DefaultView;
CollectionPager1.BindToControl = Repeater1;
Repeater1.DataSource = CollectionPager1.DataSourcePaged;
Repeater1.DataBind();
}
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
}
|
|
|
|
 |
|
 |
Hi,
I used this on my website but i notice one thing. If the current url doesn't have an exact page name, mean if I use http://www.mydomain.com/folder/ not http://www.mydomain.com/folder/default.aspx the generated url consist of 2 ?? marks before the query string key.
|
|
|
|
 |
|
 |
Hi , i've a datalist and i want to make two pagers ,one above the datalist and the other is below the list, how can i do that with ur control ??? thank you .
|
|
|
|
 |
|
 |
I worked using all the bug fixes here and now I have commented on the class corrected.
I would suggest to developer, download it and put it back in code project.
Meanwhile aconmtece not, who want the new version send me an email I sent.
diogolmenezes@gmail.com
|
|
|
|
 |
|
 |
Could you send me the latest version?
suresh_pnc@yahoo.com
|
|
|
|
 |
|
 |
Hi...I wanna add css on Collection pager's paging, and even I have done this, but the prb is I am unable to apply css only on Selected Page Number. Other is ok...
So plz help me...
Thanks
Deepak MIttal
|
|
|
|
 |
|
 |
hi
would you mind send me your CollectionPager Source Code for me Please?
thanks alot
malooss2002@yahoo.com
Farzaneh Ansary(Fafar)
|
|
|
|
 |
|
 |
This really does not deserve an answer ..but..
Download It with the Link - that is what the link for download is for.
|
|
|
|
 |
|
 |
when i use this property to go to a pageindex this DataSourcePaged.CurrentPageIndex out of order
Help me, please
|
|
|
|
 |
|
 |
Hey there excellent as can be I have not found anything that compares to it how ever there is a problem and I do not know how to solve the issue.
I am on asp.net 3.5 have a datalist in an update panel with one pager it works great using pagingmode="postback", now try it with two say one at the top and one at the bottom only one of them with work, the page does not get updated and either both pagers unless one is working and that is the case one works the other does not.
I have tried using triggers in update panel both AsyncPostBackTrigger and PostBackTrigger nothing.
How do I get them both to work and update just the same way as if there is not update panel?
Thank you.
the badass badboy
modified on Thursday, October 9, 2008 5:19 AM
|
|
|
|
 |
|
 |
This control doesn't render the id attribute(ClientID) on the surrounding div.
Adding the client id fixed the problem.
//-------------------------------
// START CONTROL
//-------------------------------
bool IsSpaceNeeded = false;
Html.Append("<div");
if(_ControlStyle.Length>0)
{
Html.AppendFormat(" style='{0}'", _ControlStyle);
}
if(_ControlCssClass.Length>0)
{
Html.AppendFormat(" class='{0}'", _ControlCssClass);
}
Html.AppendFormat(" id='{0}'", base.ClientID);
|
|
|
|
 |
|
 |
hi i have used this control in a test project i am doing and it does not seem to work when you want to dynamically filter the data.
you can download my code here
http://www.a-wright.co.uk/EstateAgentsDAL.zip
If you get it to work please let me know
|
|
|
|
 |
|
 |
how do you get this to work when your using a strongly typed dataset class in objectdatasource? can anyone help
|
|
|
|
 |
|
 |
i met the same problem ,if you have the sulution please let me know
|
|
|
|
 |
|
 |
hi i'm new to .net , can this be used with an object datasource? which part of the code must i change?
|
|
|
|
 |
|
 |
The control does not generate paging URLs correctly on IIS when application uses cookieless session. The session key is not added to the url. (It works on studio 2008 development web environment).
The problem is that Request.RawUrl does not have the session key,
Fix: (is there a better one?)
At the end of UpdateQueryStringItem added code:
.....
string newBase = ResolveUrl(httpRequest.AppRelativeCurrentExecutionFilePath);
NewURL = NewURL.IndexOf("?") <= 0 ? newBase + NewURL.Substring(NewURL.IndexOf("?")) : newBase;
return NewURL;
|
|
|
|
 |