10 Replies - 648 Views - Last Post: 03 October 2012 - 03:21 AM Rate Topic: -----

#1 inkey  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 26-June 12

Tab load Grid

Posted 01 October 2012 - 08:52 AM

Hi guys i have a 5 tabs and with in each of the tabs i have a grid. When i click on the tab the grid does not load. It loads when i click.

Does anyone know how i get a grid to load when i click on the tab.
Is This A Good Question/Topic? 0
  • +

Replies To: Tab load Grid

#2 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3652
  • View blog
  • Posts: 11,421
  • Joined: 05-May 12

Re: Tab load Grid

Posted 01 October 2012 - 09:04 AM

Without seeing your code, I would say the way to get the grid to load is by having code in the tab to handle the click event for the tab.

Personally, though, the way I've dealt with the tab control in the past was to use the events surrounding a tab being selected, rather than the click events. Some folks still use the keyboard, you know.

This post has been edited by Skydiver: 01 October 2012 - 09:04 AM

Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5633
  • View blog
  • Posts: 12,086
  • Joined: 02-June 10

Re: Tab load Grid

Posted 01 October 2012 - 12:35 PM

Quote

When i click on the tab the grid does not load. It loads when i click.


If you can't figure out whether or not it loads when you click, then what are we supposed to work with?
Was This Post Helpful? 0
  • +
  • -

#4 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 46
  • View blog
  • Posts: 407
  • Joined: 04-January 11

Re: Tab load Grid

Posted 01 October 2012 - 09:59 PM

View Postinkey, on 01 October 2012 - 08:52 AM, said:

Hi guys i have a 5 tabs and with in each of the tabs i have a grid. When i click on the tab the grid does not load. It loads when i click.

Does anyone know how i get a grid to load when i click on the tab.


It is hard to understand your question saying it does not load when you click the tab but loads when you click. Click what?

It would be better to rephrase your question and send us more details about what you are trying to do.
Was This Post Helpful? 0
  • +
  • -

#5 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 314
  • View blog
  • Posts: 490
  • Joined: 13-June 12

Re: Tab load Grid

Posted 02 October 2012 - 12:40 AM

My guess: "It doesn't load when I click the tab, but loads when I click the DataGridView".

Take the code from your DGV click event and put it into the tab's selected event.
Was This Post Helpful? 0
  • +
  • -

#6 inkey  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 26-June 12

Re: Tab load Grid

Posted 02 October 2012 - 01:45 AM

Sorry if my question did not make any sense.
I have created a number of different tabs. Inside each tab i have placed a grid. The grid does not load when the tab has been selected. The grid will only appear on a click event. Is there a way to make a grid load when a tab has been selected.
Was This Post Helpful? 0
  • +
  • -

#7 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 314
  • View blog
  • Posts: 490
  • Joined: 13-June 12

Re: Tab load Grid

Posted 02 October 2012 - 02:06 AM

See if you can look at the MSDN page for TabControl Class and find an event you could use...
Was This Post Helpful? 0
  • +
  • -

#8 inkey  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 26-June 12

Re: Tab load Grid

Posted 02 October 2012 - 02:19 AM

View PostMrShoes, on 02 October 2012 - 02:06 AM, said:

See if you can look at the MSDN page for TabControl Class and find an event you could use...


Theres no event for load on tab click?
Was This Post Helpful? 0
  • +
  • -

#9 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 314
  • View blog
  • Posts: 490
  • Joined: 13-June 12

Re: Tab load Grid

Posted 02 October 2012 - 03:17 AM

View Postinkey, on 02 October 2012 - 09:19 AM, said:

Theres no event for load on tab click?

I don't think that's what you want. Don't you want the DGV to load when you change the tab? Then you need this.
Was This Post Helpful? 1
  • +
  • -

#10 inkey  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 26-June 12

Re: Tab load Grid

Posted 03 October 2012 - 01:13 AM

This is what i have for my selected index and i have set the event to hit this method. This still does not load the grid even tho the selected index is == 0
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Code to run when SelectedIndex changes      

            if (goodproducttab.SelectedIndex == 0 )
            {
                GoodProductGrid_Load(sender, e);
            }
          
        }

Was This Post Helpful? 0
  • +
  • -

#11 inkey  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 26-June 12

Re: Tab load Grid

Posted 03 October 2012 - 03:21 AM

Turns out that because im using a outside datagrid control not the standard one that comes with windows that is what is causing the problem.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1