This is a migrated thread and some comments may be shown as answers.

RadGridView functionalities

1 Answer 259 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Arif
Top achievements
Rank 1
Arif asked on 19 Sep 2008, 12:15 PM
Hi
Am new to telerik and we are evaluating the RadGridView functionality for our project. I have worked some time but couldnt completely make a point of following functionalities needed by us. Can you please help me to resolve the same

1)Can we show only limited specified fields of the object binded along with some unbounded columns(like check box for selection). How to state to show only few and not all the fields of the binded object.

2) Once the grid is binded to any generic collection, can we add a new object of the same type to the grid to create a new row.(Is it mandatory that the collection should implement IBindingList, if not it throws expection when trying to add a new object/row ). What is the best way to add a new row in this scenario.
Also, the newly added row should be able to have selectable combobox, datetime and other controls to select right option for the column, which can then be individually captured to set for the corresponding object of the row.
Note: I may not need this comobox in same cell of other rows. Something like, all other rows be noneditable and only the newly added  row cells are editable and once the focus is lost, its made uneditable.
How can I place controls like RichTextBox, datetimeEditor, ComboBox into the cells.
This is a major point of focus, any code example will be appreciated.

3) Handling sorting.
I see there is a SortChanging event, which gives the new header values for sort.
As our DB is huge and we implement our own custom sorting along with pagination, we would like to handle the sort.
Isn't there any SortHandled property in this event as we dont want to make e.cancel, doing which it doesnt show the sort indicators.

4) Hierarchy : How to achive heirarchy with 
    a) Collection of objects (for which we can have heirarchy condition)
    b) DataSet

5) An example of showing that individual cells can accept different controls like checkboxes, combobox, datetime, image editors etc.,

6) Any Printing option from the grid.

7) Any Paging : Like many of the webgrid does when binded to DB.

8) Some kind of RowInitialised event, where in we can set that row cells to be editable/ non editable or row to be visible/hidden.

Help for the points with an example code will be very helpfull so as to know if RadGridView can be used in our project.

Thanks in advance.
Arif

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 23 Sep 2008, 01:04 PM
Hi Arif,

Thank you for interest in our WinForms products.

Please find the answers below:
  1. Yes, you can show only necessary fields from your datasource object. You may or may not add all columns, or you could set the visibility for the unwanted columns to false. Additionally, we do not limit the addition of bound and unbound columns. For more information review this help section: http://www.telerik.com/help/winforms/grid_columns.html
     
  2. RadGridView uses the standard ways of adding new rows, much like the ones you will find in Microsoft's GridView. If you use custom business objects, such as List<T>, you must implement the IBindingList and the INotifyPropertyChanged interfaces in order to notify the grid about any changes in your data source. A simple way to do this is to use BindingList<T> instead of List<T>.
    Nevertheless, you could use the integrated "add new row" functionality. It gives you the needed API to insert new rows, exactly as you have described. You could also set the column types when create a new column. Every column type has its own editor such of TextBox, ComboBox, DateTimePicker, etc.
    You could find detailed info on the topic in the online help section (see above).
    If you need running examples, please preview the provided RadControls for WinForms examples - it contains a number of different scenario with code samples.
     
  3. Detailed description about GridViewCollectionChangingEventArgs you could find here: http://www.telerik.com/help/winforms/grid_sorting-events.html
     
  4. Again you can find a hierarchy example in our Examples application. There are two main options: to use auto generated hierarchy from the datasource, or to build it manually using relation. Please, review the following help topic: http://www.telerik.com/help/winforms/grid_binding-to-hierarchical-data.html
     
  5. There is a help topic of adding custom elements to a grid cell: http://www.telerik.com/help/winforms/grid_adding-custom-elements-to-cells.html
     

  6. You could print RadGridView via printing capabilities of Telerik Reporting. Take a look to the following KB article: http://www.telerik.com/support/kb/article/b454K-baat-b454T-cta-b454c-cta.aspx
     
  7. Currently RadGridView does not support paging. This feature is with lower priority, because there is virtual mode that can be used to handle huge number of records. With virtual mode, you can implement your own data management operations and optimize performance when interacting with large amounts of data.
     
  8. You could use the RowFormating event for data rows only, and ViewRowFormating event for the all rows.
I will suggest reviewing the examples which are installed with our tools, as well as the documentation - I am sure these resources will answer most of your initial questions.
 
 
Greetings,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Arif
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or