How to Change Focus When Clicking a DataGrid Row

The Microsoft .Net framework allows programmers to rapidly produce applications for Web and desktop PC applications. The framework provides a rich tool set for developing graphical user interfaces (GUI). One such tool is the "DataGrid," which displays data in rows and columns. Users interact with the "DataGrid" by focusing on it. When a cell is focused on, it can be edited. Changing focus is a very easy thing to do and requires no programming knowledge.

Things You'll Need

  • Computer with Visual Studio 2010 installed
Show More

Instructions

    • 1

      Load the Visual Studio 2010 software by clicking on its icon. After it has finished loading, select "File" followed by "New" and "Project" to open up a "New Project" dialogue window. Select "Visual C#" from the column on the left-hand side of the window, and then select "Windows Form Application" from the right-hand side of the window. A new Windows Form project is created, and a blank form appears in the main editor window.

    • 2

      Locate the panel called "Toolbox." The "Toolbox" can be on either the left- or right-hand side of the main editor window. Inside the "Toolbox" panel is a list of all the usable graphical components you can add to your form.

    • 3

      Locate the item "DataGridView" within the "Toolbox." Drag the mouse cursor over to the Windows Form, and then release the mouse button. This places the "DataGridView" on the form.

    • 4

      Click on the small black triangle, which is found on the upper-right side of the "DataGridView" component. A menu opens. Click on "Add Column" to add a column.

    • 5

      Execute the software by pressing the green "Play" button located on the top menu of items. A Windows Form appears and features a "DataGrid" with one column.

    • 6

      Click once on a row to give it focus. This row is highlighted blue to symbolize that it is the focused row.

    • 7

      Click again on a cell in the row to allow content editing. You can write whatever you like from the keyboard to edit the cell contents.

Related Searches:

References

Comments

Related Ads

Featured