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,
I''ve got a GridAwareTextBox attached to a virtual grid. I want it to show the actual value of the current cell so that users can edit the underlying values of my grid, but it always shows the formatted value (so the users are effectively loosing large amounts of the data).
Likewise, when a cell goes into edit mode I''d like it to show the true value not the formatted value.
eg if the CellValue is 0.005 and the format is set to N2, the cell shows 0.01. When the cell is selected the GridAwareTextBox should show 0.005 and the grid (still) 0.01. When I start editing the cell the grid cell should change to 0.005.
How can I get this to work?
Thanks,
Sue
That was a pretty good solution, but it prevents combo boxes from being able to change the cell value.
Cheers,
Sue
ADAdministrator Syncfusion Team March 28, 2006 05:31 AM UTC
Hi Sue,
Setting the e.Text to cc.Renderer.ControlValue.ToString() in the QueryCellFormattedText event handler works for ComboBox cell types also. Below is a code snippet. Let me know if this helps.
private void gridControl1_QueryCellFormattedText(object sender, GridCellTextEventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
if(e.Value !=null&& e.TextInfo == GridCellBaseTextInfo.CurrentText)
{
//e.Text = e.Style.Text;
e.Text = cc.Renderer.ControlValue.ToString();
e.Handled = true;
}
}
Regards,
Calvin.