The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator Syncfusion Team 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
ADAlberto del BarrioOctober 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
ADAdministrator Syncfusion Team 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.