Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How to bind values to the Grid in WPF?

Back to Forum: Tech Off
  • User profile image
    cssavinashi

    I have created a Grid object and added column and row definitions to the Grid. I want to bind the data for the grid columns.

    Is there any way to bind the data for the Grid as like normal VS .Net 2003

    (i.e. DataGrid1.DataSource = ds) If it is not possible in WPF, how can i bind the values to the Grid in WPF.

    OTHER IMPORTANT Thing is I want to create a DataGrid which is to be good look-and feel (Which should not be like normal WinForms grid, instead it should be good style as with moulded borders, using nice colors, and should also perform event handling.(such as mouse move, mouseover,dragover..)

    It should also allow us to add any type of controls(such as Calender control, dropdownlist, popup menus, context menus). It also have some 2D and 3D effects.

    Is it possible for me to create a grid(datagrid) which satisfies all the above requirements using WPF? In what way can i achieve this?

    My new grid mostly resemble like XtraGrid(third party grid component). Is it possible to create such grid in WPF? If any information available regarding this pls let me know where i can find. i need it very urgently.

  • User profile image
    kaul

    Regarding your second question: Yes a grid of look and feel like your description can designed using wpf. You can use LinearGradientBrush for providing a "cool" background (you can use it  to create  "style" for background), you can further describe the SkewTransforms, TranslateTrasform, RotateTransform and ScaleTransforms to make it more presentable. As far as moulded borders are concerned you can use a trick here - increament the no. of rows and columns in your grid by n+1, change width/height of  alternate rows and columns of grid exceptionally small (e.g. 2-3) and set its background to some color lighter than that you used for grid background (e.g. #50000000 and #50ffffff is a good combination). Now insert in each cell (except those of smaller width ) border and give some suitable color to this border.The grid will look good Wink. Furthermore you can insert any control into the cells of this grid.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.