Advertisement

07.03.2008 at 01:12PM PDT, ID: 23538064
[x]
Attachment Details

problem: grid view fired event pageindex changing which wasnt handled

Asked by 12345bob in Programming for ASP.NET, C# Programming Language, .NET Framework 3.x versions

Tags: c#.net

i have a data grid displayed on the screen.this is binded to a dataset.
when i run my application what is happening is that...there are 6 records in the data base..
and paging is enabled in the data grid and i have chosen to display only 3 records at a time.
when i run my application i am able to see only  3 recordds form the database.
when i click the next button(which i typed through properties box) in the data grid it says "grid view fired event pageindex changin which wasnt handled ".
can anyone help me with this issue and provide me a code on how to handle that event.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
    {
        DataSet ds = new DataSet();
               
        
        string cs = System.Configuration.ConfigurationManager.ConnectionStrings["connstring"].ConnectionString;
 
        SqlConnection con = new SqlConnection(cs);
        con.Open();
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = con;
        cmd.CommandText = "SELECT * FROM CONTACT_ENTITIES";
 
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        da.Fill(ds);
 
        //for (i = 0; i <= ds.Tables[0].Rows.Count; i++)
        //{
        //    main.InnerText += ds.Tables[0].Rows[i]["name"].ToString();
        //}
 
        
       GridView1.DataSource = ds;
       GridView1.DataBind();
           
        }
    //public event EventHandler GridViewSortingEventHandler;
 
 
    //void GridView1_Sorting(Object sender, GridViewSortEventArgs e)
    //{
    //    this.GridView1.Sorting += new GridViewSortingEventHandler(this.GridView1_Sorting);
    //}
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
             
        
    }
[+][-]07.03.2008 at 01:40PM PDT, ID: 21928842

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.03.2008 at 02:02PM PDT, ID: 21929030

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.03.2008 at 02:24PM PDT, ID: 21929240

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, C# Programming Language, .NET Framework 3.x versions
Tags: c#.net
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628