We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom properties in a custom cell

Thread ID:

Created:

Updated:

Platform:

Replies:

7959 Oct 15,2003 03:10 PM UTC Oct 16,2003 08:44 AM UTC WinForms 3
loading
Tags: GridControl
Alberto del Barrio
Asked On October 15, 2003 03:10 PM UTC

Hi all, I've created a custom cell type, which has some properties the user can configure at design time. At runtime, I want to access the values of this properties from the OnDraw method on the renderer class for the cell to get the value of this properties. I can see it is stored under the CustomProperties of the style object I receive as a parameter, but I can't access that value. Is there any other way?

Administrator [Syncfusion]
Replied On October 15, 2003 04:04 PM UTC

Check out the Grid\Samples\CellTypes\SliderCells example and/or also PictureBoxCells. You have to attach the GridStyleInfo object to your custom properties class. Example: public static void InitializeSlider(TrackBar c, GridStyleInfo style) { SliderStyleProperties sp = new SliderStyleProperties(style); // Now, access SliderStyleProperties through sp ... Stefan

Alberto del Barrio
Replied On October 16, 2003 04:00 AM UTC

OK, I've already done that, but the thing is with that code I can assign the values I have in my custom properties to the instance of my control I use internally; public static void InicializarFecha(Fecha fechaLista, GridStyleInfo style) { FechaListaProperties fechaProp = new FechaListaProperties(style); fechaLista.ModeloControl.Valor = fechaProp.Valor; fechaLista.ModeloControl.Formato = fechaProp.Formato; InicializarFecha(fechaLista,style.CellValue); } Now, how can I assign values to that properties depending on user configuration? Because otherwise I'll be always using the values of the properties set for the default object Thanks

Administrator [Syncfusion]
Replied On October 16, 2003 08:44 AM UTC

Is your question, how do you initialize these special style properties depending upon the cell? Going back to the slider example, when you want to set the special slider properties depending upon a particular cell, you use this code from main.cs. style = gridControl1[row, 3]; sp = new SliderStyleProperties(style); style.CellType = "Slider"; sp.Maximum = 40; sp.Minimum = 0; sp.TickFrequency = 8; sp.LargeChange = 16; sp.SmallChange = 4; Then in your custom cell code, when the cell is (row, 3), these will be the values used in InitializeSlider(TrackBar c, GridStyleInfo style) to set the state for the TrackBar c depending on the values in the style.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;