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.
I derived my own GridCellRenderer from GridDropDownCellRenderer. I'd like it to function similar to ComboBox - with support for saving one value and showing another.
The problem is that, when I type value into the grid's cell (for example 'v2', which is correct and should be save as 2) and press Enter I get message that "'v2' is not a valid value for Int64".
It seems that Renderer tries to save the ControlText property to DataSource, not the ControlValue, which I'd like to be saved. (When ControlText can be cast to Int64 everything seems to be right)
Is there any way to save the ControlValue property to DataSource.
Unfortunatelly I didn't manage to attach an example - I get some errors in the WebPage when I try to attach anything :(
This is what I get:
Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
HAhaneefm Syncfusion Team March 28, 2007 07:59 PM UTC
Hi Marek,
You would have to derive the GridDropDownCellRenderer and override the OnSaveChanges method to save the ControlValue directly. Please try the below code snippet and let me know if this helps.
public class MyDropDownCellRenderer : GridDropDownCellRenderer { protected override bool OnSaveChanges() { this.Grid.Model[RowIndex,ColIndex].CellValue = this.CurrentCell.ControlValue;//save the cell value directly. this.CurrentCell.IsModified = false; return true; } }
Best Regards, Haneef
MSMarek SolarskiMarch 29, 2007 11:27 AM UTC
Hi Haneef,
I derived protected override bool OnSaveChanges() as you said and it didn't help.
The example I wanted to attach can be downloaded from here: http://www.infokrak.com.pl/download/wa24.zip
Have a look at it please.
Best Regards, Marek
HAhaneefm Syncfusion Team March 29, 2007 09:12 PM UTC
Hi Marek,
Try override the OnValidate method to achieve this. Please try the modified sample and let me know if this helps.