An array of C#, PHP, and HTML programming articles, tutorials, and resources

Posts Tagged ‘ Visual Studio ’

Microsoft Visual Studio 2008 is by far one of my personal favorite Integrated Development Environments (IDE). However, it is also no secret some aspects of the IDE are overly bloated and therefore take forever to load or execute. One portion that drives me crazy is the time it takes Visual Studio 2008 to load up. By default (after a standard installation), Visual Studio 2008 opens the start page, which a screen containing recently open solutions as well as links to MSDN containing latest Microsoft programming news. I never looked at the news and instead always immediately opened a solution.

Now, I have run across a setting buried deep in the options that allows this to be changed to any one of following options:

  1. Open Home Page
  2. Load last loaded solution
  3. Show Open Project dialog box
  4. Show New Project dialog box
  5. Show empty environment
  6. Show Start Page

I chose “Show Open Project dialog box” which for my needs makes the most sense. Nearly 95% of my time I open Visual Studio, my aim is to add new features or fix bugs. It loads blazing fast as compared to”Open Home Page” or “Show Start Page” because no overheard is required to visit the MSDN website.

The options dialog box in Visual Studio 2008

To get to the dialog box, go to Tools > Options. Once in the dialog box, you go to Environment > Startup. Simply use the Dropdown Box and select your desired startup option.

If you do make a change (or have made a change prior to reading this article), what setting do you use?

We begin with a standard Panel control. With the Panel control, we can control the width, height, and scrollable option. For our code example, we set the height as 200px, the width as 100%, and set the Panel to scroll while showing only the vertical scrollbars. We will give the Panel the id pnlWrapper.

<asp:Panel ID="pnlWrapper" runat="server" Height="200px" Width="300px" ScrollBars="Vertical">
</asp:Panel>

Our next step is to add to pnlWrapper a GridView that we will assign the id gvScrollableExample. In the sample code below, the GridView will appear as only height 200px and width 300px as we have constrained in pnlWrapper. However, given enough bound data, the Header Row of gvScrollableExample will scroll out of view.

<asp:Panel ID="pnlWrapper" runat="server" Height="200px" Width="300px" ScrollBars="Vertical">
<asp:GridView ID="gvScrollableExample" runat="server">
</asp:GridView>
</asp:Panel>

To fix this, we add a bit of CSS to ensure the Header Row will stay in view. In this situation, the Header Row will act as if it were hoovering above the data. For this to work, we will add inline CSS between the html’s head page as shown below:

<head>
  <style type="text/css">
    .gvFixedHeader
    {
      font-weight:bold;
      position:relative;
      background-color:White;
    }
  </style>
</head>

Next, we have to assign the CSS class to the GridView’s HeaderStyle. This can be done via Visual Studio’s GUI, or we can do it in code. Continuing from our example above, the new extended code will look like:

<asp:Panel ID="pnlWrapper" runat="server" Height="200px" Width="300px" ScrollBars="Vertical">
  <asp:GridView ID="gvScrollableExample" runat="server">
    <HeaderStyle CssClass="gvFixedHeader" />
  </asp:GridView>
</asp:Panel>

The GridView is now ready for you to Bind data. This concludes the tutorial on creating a scrollable GridView with a Fixed Header in Visual Studio. Let me know if there are any questions!

I’ve been programming in Visual Studio for nearly a year. What I have learned is using keyboard shortcuts is the perfect way to make coding more enjoyable. One feature Microsoft Visual Studio 2008 offers is Intellisense. It is Microsoft’s way of helping programmers complete (without fully typing) intended methods, variables, extensions, etc.

When I first started, I would attempt to access an object’s method only to realize I had selected the wrong method. I would then need to delete past the period, then press period again to see all the Intellisense options. Now, I know and use all the time the shortcut CTRL+SPACE to bring up the Intellisense menu.

With the keyboard shortcut CTRL+SPACE, there is no need to delete unwanted characters in the existing Intellisense. This shortcut will take the existing characters into consideration when displaying the options. Either way, the easiest way is to try this yourself!