XtraVerticalGrid Data Binding

mundanemushroomsΗλεκτρονική - Συσκευές

21 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

96 εμφανίσεις







Learn

more at devexpress.com

Copyright © 2008 Developer Express Inc

ALL RIGHTS RESERVED

XtraVerticalGrid


Data Binding

In this lesson, I’m going to show you how to bind XtraVerticalGrid to an Access Database.

1.

First, let’s drop an XtraVerticalGrid Control onto a form,
and

make it fill the form.


2.

Now we need to create a data source and bind it to the
VerticalGrid. Both actions can be done by the grid’s smart
tag.

3.

I click the “Add Project Data Source” link to start the data source configuration wizard.

4.

I choose the data sour
ce type, which is “Database” in our case.

5.

Then I proceed to the next page to choose the data connection.

6.

You can create a new connection here. All you have to do is locate the desired database file on
the disk.

7.

I’ll use an existing connection.

8.

In the last
step, I’ll select the “Employees” data table which will supply data to our VerticalGrid.

9.

And I’m done with the data source configuration.

10.

The XtraVerticalGrid Control allows rows to be arranged into a tree.







Learn

more at devexpress.com

Copyright © 2008 Developer Express Inc

ALL RIGHTS RESERVED

11.

To customize the row layout, I run the designer.


12.

So, I’m going to logically divide all rows into two groups.

13.

The first group will contain the main information on employees, their first and last names, title,
birth and hire dates.

14.

I create a “Category Row” and change its caption to “Employee”.


15.

Now, I’
ll drag the desired rows onto it.







Learn

more at devexpress.com

Copyright © 2008 Developer Express Inc

ALL RIGHTS RESERVED

16.

The second group will contain address information.

17.

I add the second “Category Row”, let it be “Address”…

18.

…and drag the rows onto it.

19.

Since I don’t need to display the other rows, I delete them.

20.

I close the designer, and
run the application to see the result.

21.

A VerticalGrid Control is filled with data from the bound data table.