Gabriel Posted October 16, 2018 Share Posted October 16, 2018 Hi, I'm having an issue with the unistringgrid. I'll try to explain. I'm using a UniStringGrid so the user can enter some data (as detailed here http://forums.unigui.com/index.php?/topic/11309-solved-unistringgrid-editorview), which works great, but i'm having trouble saving the information to a text file, the problem is that the grid trims the blank spaces at the beginning of the cell but only when i add them myself. Some images: When i load the app and press the button show text: I edit the first cell adding a lot more blank space at the beggining and then click on Show Text The text has been trimed. I attach a test project. It would be great if someone can help me. Regards UniStringGrid.zip Quote Link to comment Share on other sites More sharing options...
Gabriel Posted October 19, 2018 Author Share Posted October 19, 2018 Any ideas on how to solve this? is this a bug? Regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 19, 2018 Share Posted October 19, 2018 Hi, We will check and let you know Quote Link to comment Share on other sites More sharing options...
Gabriel Posted October 26, 2018 Author Share Posted October 26, 2018 Sherzod, Sorry to bother you again. Any news about this topic? Thanks Regards, Gabriel Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 26, 2018 Share Posted October 26, 2018 Gabriel, Sorry for the delay, I'm checking now Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 26, 2018 Share Posted October 26, 2018 You can open the request in the support portal...: procedure TUniStringGrid.SetCellValue(ACol, ARow:Integer; OldValue, NewValue: Variant; AuxParam: string); var Attr, S : string; begin if (ACol < FColumnCount) and (ARow < FRowCount) then try FInternalSet := True; S := Trim(NewValue); <------------ ... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 27, 2018 Share Posted October 27, 2018 As a workaround, you can try this approach: procedure TMainForm.UniStringGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var colIdx, rowIdx: Integer; begin if EventName = '_edit' then begin colIdx := StrToInt(Params.Values['colIdx']); rowIdx := StrToInt(Params.Values['rowIdx']); (Sender as TUniStringGrid).Cells[colIdx, rowIdx] := Params.Values['val'] end; end; function edit(editor, context, eOpts) { var ctx=context; ajaxRequest(ctx.grid, '_edit', ['colIdx='+ctx.colIdx, 'rowIdx='+ctx.rowIdx, 'val='+ctx.value]); return false; } Quote Link to comment Share on other sites More sharing options...
Gabriel Posted October 29, 2018 Author Share Posted October 29, 2018 Many thanks. I've try the workaround and it works great. But also i've submited the issue to the support portal. Thanks a lot. Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.