6 Replies - 5685 Views - Last Post: 08 March 2011 - 08:36 AM Rate Topic: -----

#1 chirag.makwana1989   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 31-January 11

How to show a gif image like progressbar till the particular process i

Posted 08 March 2011 - 03:13 AM

I have a specific requirement in C#.net window application. That is i have one gif image which shows a busy process when fill gridview if gridview fill complete then visible false image..This image has to show till my back end process has to be completed. Please help me how to do this in Gridview filling process...
Is This A Good Question/Topic? 0
  • +

Replies To: How to show a gif image like progressbar till the particular process i

#2 marinus   User is offline

  • D.I.C Addict
  • member icon

Reputation: 138
  • View blog
  • Posts: 575
  • Joined: 14-April 10

Re: How to show a gif image like progressbar till the particular process i

Posted 08 March 2011 - 03:36 AM

hava you tried this ?

pictureBox.Visible = true;
//Filling dataGrid
pictureBox.Visible = false;



Was This Post Helpful? 0
  • +
  • -

#3 chirag.makwana1989   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 31-January 11

Re: How to show a gif image like progressbar till the particular process i

Posted 08 March 2011 - 04:16 AM

No.
But My Problem is that when i am filling gridview after the picturebox process generet...
i want when i fill gridview at that time this process generet. and when coplete this is visible false..
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6535
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How to show a gif image like progressbar till the particular process i

Posted 08 March 2011 - 05:44 AM

Have you made any effort to code this on your own?
A requirement of this site is that you make a good faith effort to resolve your own issues, especially simplistic ones like how to show an image. Please make an effort to write some code for this before asking others to do it for you.
Was This Post Helpful? 0
  • +
  • -

#5 chirag.makwana1989   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 31-January 11

Re: How to show a gif image like progressbar till the particular process i

Posted 08 March 2011 - 06:22 AM

yes sir i had try to write this code in my application but problem is that when gridview fill copleted after picturebox shown..
my code is
this is my gridview method.
public void gridview(DevExpress.XtraGrid.GridControl grid, string query)
        {
            SqlConnection connection = new SqlConnection(Connectionstring);
            //connection.Open();
            SqlCommand command1 = new SqlCommand(query, connection);
            SqlDataAdapter dataAdapter = new SqlDataAdapter(command1);
            DataSet ds1 = new DataSet();
            dataAdapter.Fill(ds1);
            grid.DataSource = ds1.Tables[0];
            //connection.Close();
        }
string value = "";
        private void Chklist_SelectedIndexChanged(object sender, EventArgs e)
        {
            int i;

            catid = "";
            pictureBox1.Visible = true;
            backgroundWorker1.RunWorkerAsync();
            foreach (object itemchecked in Chklist.CheckedItems)
            {
                i = Convert.ToInt32(Chklist.Items.IndexOf(itemchecked));
                i = i + 1;
                catid = catid + "," + i.ToString();
                if (catid.StartsWith(",") == true)
                {
                    catid = catid.Remove(0, 1);
                }
                query = "Here My Query";
                pictureBox1.Waitonload = true;
                //Cursor.Current = Cursors.WaitCursor;
                pictureBox1.Visible = true;
                pictureBox1.Waitonload = true;
                //Application.UseWaitCursor = true;
                gridView1.Columns.Clear();
                obj.gridview(gridControl1, query);
                gridView1.Columns[0].Width = 35;
                gridView1.Columns[1].Width = 150;
                gridView1.Columns[2].Width = 60;
                gridView1.Columns[3].Width = 280;
                lblRecCount.Text = gridView1.RowCount.ToString() + " Record(s)";
            }
            if (Chklist.CheckedItems.Count != 0)
            {
                foreach (object itemchecked in Chklist.CheckedItems)
                {
                    obj.gridview(gridControl1, query);
                    Counter();
                }
            }
            else
            {
                query = "My Query";
                obj.gridview(gridControl1, query);
                Counter();
            }
            pictureBox1.Waitonload = false;
            pictureBox1.Visible = false;
            //Application.UseWaitCursor = false;

        }

	  private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
           for (int i = 0; i < gridView1.RowCount; i++)
              value = value + Environment.NewLine + Convert.ToString(i);
        }

        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            pictureBox1.Visible = false;
        }



what is best for retrieving data for girdview.. Dataset or SqlDataReader.
in my database upto 20 lakh data...
so problem in execute time...
take more time to fill gridview...
also use above code..

Thanks again sir...

This post has been edited by macosxnerd101: 08 March 2011 - 06:26 AM
Reason for edit:: Please use code tags

Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6535
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How to show a gif image like progressbar till the particular process i

Posted 08 March 2011 - 06:55 AM

Taking away everything that is *not* a description of the problem, this is all that is left.

Quote

problem is that when gridview fill copleted after picturebox shown..
in my database upto 20 lakh data...
so problem in execute time...


Which really doesn't make any sense.

Maybe you should try entering the description in your native language using translate.google.com then post the English translation.
Was This Post Helpful? 0
  • +
  • -

#7 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1533
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: How to show a gif image like progressbar till the particular process i

Posted 08 March 2011 - 08:36 AM

View PosttlhIn`toq, on 08 March 2011 - 09:55 AM, said:

Taking away everything that is *not* a description of the problem, this is all that is left.

Quote

problem is that when gridview fill copleted after picturebox shown..
in my database upto 20 lakh data...
so problem in execute time...


Which really doesn't make any sense.

Maybe you should try entering the description in your native language using translate.google.com then post the English translation.


Makes perfect sense. Since he is doing every thing on the UI thread, the PictureBox isn't going to show up until after the GridView has been loaded.

chirag.makwana1989, you need to do the processing of the GridView on a background thread.

You can use this tutorial on using the BackgroundWorker class.

You could also use this tutorial on using Tasks.

Either one should work fine for you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1