Hi,
I use NetAdvantage 2012 vol.1 and I have a xamDataPresenter as a grid with only one displayed editable column binded to string value in ObservableCollection. I have some record in the collection where value = 'ORIG CONT 12/31/2013'. Grid displays truncated value to 'ORIG CONT':
but when I click the field and go to edit mode, it displays full value available to edit:
The grid is defined as:
<igDP:XamDataPresenter Name="xamDataGridContinuityHist" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ActiveDataItem="{Binding SelectedEmployeeContinuityHistory,Mode=TwoWay}" BindToSampleData="False" DataSource="{Binding EmployeeContinuityHistories,Mode=TwoWay}" GroupByAreaLocation="None" Theme="[current]" Padding="0,0,7,0" BorderThickness="0,0,10,0" ScrollingMode="DeferredWithScrollTips" ScrollBehaviorOnListChange="PreserveRecordsInView"> <igDP:XamDataPresenter.Resources> <Style x:Key="NotesFieldStyle" TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="TextWrapping" Value="Wrap" /> <Setter Property="TextBlock.Background" Value="Brown" /> <Setter Property="Background" Value="LightSteelBlue" /> <Setter Property="AcceptsReturn" Value="True" /> <Setter Property="Selector.SelectedIndex" Value="0" /> <Setter Property="Selector.SelectedValue" Value="" /> </Style> </igDP:XamDataPresenter.Resources> <igDP:XamDataPresenter.FieldLayoutSettings> <igDP:FieldLayoutSettings AllowAddNew="True" AddNewRecordLocation="OnBottom" AllowDelete="False" AutoArrangeCells="Never" AutoGenerateFields="False" DataErrorDisplayMode="ErrorIconAndHighlight" HighlightPrimaryField="Highlight" SupportDataErrorInfo="RecordsAndCells" SelectionTypeCell="None" /> </igDP:XamDataPresenter.FieldLayoutSettings> <igDP:XamDataPresenter.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="NOTES" Width="400" Column="0" Label="Notes" Row="1"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="True" EditorStyle="{StaticResource NotesFieldStyle}" /> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataPresenter.FieldLayouts> <igDP:XamDataPresenter.FieldSettings> <igDP:FieldSettings AllowEdit="True" CellClickAction="EnterEditModeIfAllowed" /> </igDP:XamDataPresenter.FieldSettings> <igDP:XamDataPresenter.View> <igDP:GridView> <igDP:GridView.ViewSettings> <igDP:GridViewSettings Orientation="Vertical" /> </igDP:GridView.ViewSettings> </igDP:GridView> </igDP:XamDataPresenter.View></igDP:XamDataPresenter>
I tried to create a sample project with exact the same grid and data and it works fine, i.e. displays complete value. What could be a reason of this behavior ?
Thanks,
Ed
Hello Ed,
Thank you for your post. I have been looking into it and I noticed that there is an editor Style applied to the “NOTES” Field – “NotesFieldStyle” and I can suggest you try to remove it and see if the issue still occurs. If not you should check this style. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Hi Stefan,
First, I tried to remove setter for Property TextWrapping=Wrap in the field style and it worked, field displays full value...However text wrapping was set for the reason - users want to enter multiline notes which look something like
I also noticed that if I enter any character - period, comma, underscore at the end of string (and after the date), the value is displayed fine. Even more, it works when I enter date in short format '12/31/13' or at some other format like <dd.mm.yyyy> or <yyyy-mm-dd>. Even '1/31/2013' works but '01/31/2013' - doesn't. I have an impression that the date in <mm/dd/yyyy> format is considered as some special character.