Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
695
UltraGrid with different controls on each row of particular column.
posted

Hi,

I am using Ultragrid for some set of properties which should be applicable to some data.

which is the best way to implement different controls inside a cell.

For example consider a grid with 3 rows with 2 columns. All the below controls are applied on the same column (2nd column).

1) First Row second column should have UltraComboEditor

2) Second Row Second column should have UltraCheckEditor

3) Third Row Second column should have TextBox (not using UltraTextEditor because of lack of support for autocomplete text). Is the autocomplete added to UltraTextEditor ?

Which is the easy and more performance way to implement the same. If possible, give me a sample application which explains it.

How to retrieve the data from the each type of column ?

Is there any control which may help improve the performance if it is used inside UltraGrid. if yes, kindly explain them.

Parents
  • 469350
    Offline posted

    It sounds like you are implementing something like a PropertyGrid. There's a sample installed with NetAdvantage that does this using the UltraWinTree. So you may want to take a look at that.

    There's no really simple way to do this. You can set the Style, EditorComponent, or Editor on each individual cell in the grid, and the InitializeRow event is typically a good place to do that. But there will probably be complication dealing with the data type. The column will have to use a DataType that any of the various editors can always handle, so that pretty much means your column's DataType will need to be an object. Some of the editors won't be able to deal with that, so you may have to use a DataFilter to translate the Editor value to and from the Owner value.

    Another approach you could take is to use the UltraControlContainer editor. You could write a control that has a Value property of type object and then when the Value is set, your control would display a different control within itself based on the type of the Value. This is essentially the same thing, you still have to deal with the data type of the cell value, but it's a little more centralized.

Reply Children