Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 474497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:17:37+00:00 2026-05-13T00:17:37+00:00

Lbl_Username.Text = FirstName + + LastName; if (!IsPostBack) { ds = objSun.FetchTravelDetails(userId); int datasetcount

  • 0
Lbl_Username.Text = FirstName + " " + LastName;
    if (!IsPostBack)
    {
        ds = objSun.FetchTravelDetails(userId);
        int datasetcount = ds.Tables[0].Rows.Count;
        if (datasetcount == 0)
        {
            dt.Columns.Add("request_ID");
            dt.Columns.Add("userId");
            dt.Columns.Add("");
            dt.Columns.Add("status");
            dt.Columns.Add("remark");
            dt.Columns.Add("");
            for (int i = 0; i < 9; i++)
            {
                DataRow dr = dt.NewRow();
                dt.Rows.Add(dr);
            }
            GridView_RequisitionManagement.DataSource = dt;
            GridView_RequisitionManagement.DataBind();
        }
        else
        {
            GridView_RequisitionManagement.DataSource = ds;
            GridView_RequisitionManagement.DataBind();
        }
    } 
}

protected void GridView_RequisitionManagement_RowDataBound(object sender, GridViewRowEventArgs e)
{
    int datasetcount1 = ds.Tables[0].Rows.Count;
    if (datasetcount1 != 0)
    {
        for (int i = 0; i < GridView_RequisitionManagement.Rows.Count; i++)
        {
            LinkButton lnk_view = new LinkButton();
            lnk_view = GridView_RequisitionManagement.Rows[i].FindControl("LinkBtn_ViewFullDetails_GridView_LeaveManagement") as LinkButton;

            int type = Convert.ToInt32(ds.Tables[0].Rows[i]["request_Type"].ToString());
            string typeName = "";
            string requestId = GridView_RequisitionManagement.DataKeys[i][0].ToString();
            string request_userId = GridView_RequisitionManagement.DataKeys[i][1].ToString();
            switch (type)
            {
                case 2:
                    {
                        typeName = "Travel Request";
                        lnk_view.PostBackUrl = "Status_ViewDetails_TravelClaims.aspx?requestId=" + requestId;
                        break;
                    }
                case 3:
                    {
                        typeName = "Other Claims";
                        lnk_view.PostBackUrl = "Status_ViewDetails_OtherClaims.aspx?requestId=" + requestId;
                        break;
                    }
                case 4:
                    {
                        typeName = "Petty cash";
                        lnk_view.PostBackUrl = "Status_ViewDetails_PettyCashVoucher.aspx?requestId=" + requestId;
                        break;
                    }
                case 5:
                    {
                        typeName = "Advance";
                        lnk_view.PostBackUrl = "Status_ViewDetails_AdvanceRequisitions.aspx?requestId=" + requestId;
                        break;
                    }
            }
            GridView_RequisitionManagement.Rows[i].Cells[1].Text = Convert.ToDateTime(ds.Tables[0].Rows[i]["date"].ToString()).ToShortDateString();
            GridView_RequisitionManagement.Rows[i].Cells[2].Text = typeName;
        }
    }
    else
    {
        for (int j = 0; j < GridView_RequisitionManagement.Rows.Count; j++)
        {
            GridViewRow rows = GridView_RequisitionManagement.Rows[j];
            LinkButton lnk_grd_views = (LinkButton)rows.FindControl("LinkBtn_ViewFullDetails_GridView_LeaveManagement") as LinkButton;
            lnk_grd_views.Visible = false;
        }
    }
}

protected void GridView_RequisitionManagement_PageIndexChanging(object sender, GridViewPageEventArgs e)
{

    GridView_RequisitionManagement.PageIndex = e.NewPageIndex;
    GridView_RequisitionManagement.DataSource = ds;
    GridView_RequisitionManagement.DataBind();

}

Hi guys, I need some help here. I’m using the above code to display the details
in the GridView. The DataTable and DataSet are used to populate the GridView. Now I want to do paging in the GridView, but when the next page is clicked it shows the following error:

The IListSource does not contain any data sources

and the next page in the grid shows empty.

Please assist me with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:17:37+00:00Added an answer on May 13, 2026 at 12:17 am

    It seems as though you are only setting the DataSet ‘ds’ if it isn’t a postback. So when the PageIndexChanging event is run ds is not going to be set to a dataset.

    Try moving

    ds = objSun.FetchTravelDetails(userId);
    

    Above the if(!IsPostback) line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've concatenated string using the following code: NSString *add = @a ; lbl.text =
I've got another issue. My method: public StudentProfile GetFullStudentProfile(int userID) { SqlConnection conn =
... ... ... try { string Tags_collect; SqlDataReader Data1 = cmd.ExecuteReader(); Data1.Read(); lbl_q_title.Text =
Attempting something like public string MyText { get {return lbl.Text;} set {lbl.Text = value;}}
can i use like this r not for (NSString *string in userInfo){ lblUserName.text =
I already have a custom UIAlertView and in which i want to add UIImageView
protected void btn_Submit_Click(object sender, EventArgs e) { lbl_EmpCode.Text = ; SPSite newsites = SPContext.Current.Site;
How can use this text value? Text=My custom text: {Binding MyData} In this code?
i am working on Twitter on iPhone now i have to keep the count
If I pass const string strEditParams = TaskID={0}&TaskName={1}; string strEditValues = string.Format(strEditParams, lbl.Text ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.