This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I had a couple of questions:
Kamal |
|
|
Hello Kamal 1) By default the behavior of the DataGrid is that the first click on a cell will first highlight the cell. Clicking again on a highlighted cell will put that cell into edit mode. The data grid automatically displays an editor appropriate for the type of data displayed by a cell. If you want the cell to go into edit mode on a single click, you can set the DataGrid.EditModeBehavior to DataGridCellEditModeBehavior.OnClick. There are also features that allow you to set a custom editor control for each column. The easiest way to do this is to add a DataGridColumn to the DataGrid.Columns Collection, and set the EditorTemplate of the DataGridColumn. In the EditorTemplate you can include whatever control(s) you want. Then when a cell of that column goes into edit mode, your template will be used. The DataContext of the editor template will be the object displayed by the row in the data grid. So the control in your template can bind to any of the properties on the items you add to the data grid. You can see a simple example of this by running up the Sample Explorer application that comes with the WPF Elements install. You can find this in the Start menu. When this is running, go to the "Data Grid" page and then go to the "Custom editor" page. You can click on the buttons in the bottom right corner of the application to see the xaml code. This just uses a simple TextBox with a custom converter in the data template. 2) I have attached a sample showing you how you can build a chart in code. To run the sample, make sure to include a reference to your copy of the Mindscape.WpfElements.dll. Instantiate a new Chart control and set some properties such as the Title. Create a list of data you want to display. Create one or more series that will display the data. Set the ItemsSource of the series to be the list of data. Add the series to the Chart.Series collection. Setting the axes are optional. If you don't set them, the chart will provide some default ones. Let me know if you have further questions about any of this. Jason Fauchelle |
|