0

I m trying to show grid control on ribbon page click . When clicking on different ribbon pages should show different grid . for this i m first trying to show and hide a grid on ribbon page click using Selected page event . It is not working fine an exception is coming.

My Code:

privatevoidRibbonControl_SelectedPageChanged(objectsender,RibbonPropertyChangedEventArgs e)
{
    try
    {
        if (RibbonControl.SelectedPage == ribbonPageFolder)
    {
        grdFilingTest.Visibility = Visibility.Visible;
        } 
        else if(RibbonControl.SelectedPage != ribbonPageFolder)
    {
        grdFilingTest.Visibility = Visibility.Hidden;
    }
    }
    catch(Exception ae)
    {
        MessageBox.Show(ae.Message);
    }
}
Syed Farjad Zia Zaidi
  • 3,302
  • 4
  • 27
  • 50
abc
  • 75
  • 11

1 Answers1

0

You set the visibility of a Grid Control like this:

grdFilingTest.Visible = true; // makes the grid visible 

grdFilingTest.Visible = false; // hides the grid
Syed Farjad Zia Zaidi
  • 3,302
  • 4
  • 27
  • 50
  • Are you sure it's a grid control? I have tried the above code and it worked. May be your intellisense is not working. Try writing the code and check if it works. – Syed Farjad Zia Zaidi May 28 '14 at 07:26
  • Its devexpress (Grid Control ). Normally we take Data Grid But here i m talking of grid control . – abc May 28 '14 at 07:36
  • Yes I am also using Dev Express Grid Control... The code that I wrote is working fine on my PC. However I could not find gridControl.Visibility, not even in the documentation. Did you try my code? – Syed Farjad Zia Zaidi May 28 '14 at 07:40
  • Please visit this link http://www.devexpress.com/Support/Center/Question/Details/Q504304 – abc May 28 '14 at 07:51
  • u'll come to know that visibilty exists – abc May 28 '14 at 07:52
  • Dude that not a Grid Control. C'mon read it yourself. That's DocumentPanelContacts.Visibility = Visibility.Visible;. There is a huge difference between Grid Control and DocumentPanelContacts – Syed Farjad Zia Zaidi May 28 '14 at 07:58
  • U said that visibilty attribute do not exists (not even in documentation) . I gave the link to have a look that it exists and if u still have any doubts give me ur email id i'll send u some screen shots that the same exists for GRID CONTROL – abc May 28 '14 at 08:10
  • I meant that it does not exists for GridControl, You can recheck my comment. Yes I have doubts but I am not giving you my email address. However give me a link to the official documentation that shows GridControl.Visibility. – Syed Farjad Zia Zaidi May 28 '14 at 08:12
  • https://documentation.devexpress.com/#wpf/DevExpressXpfGridGridControlMembersTopicAll – abc May 28 '14 at 08:26
  • My bad. I was checking on the windows forms, this is for WPF – Syed Farjad Zia Zaidi May 28 '14 at 08:42