Posted 14 July 2022, 5:43 pm EST
When we start to edit in a cell, X is appear in right side.Could I know how to dissapear this X ?
Forums Home / ComponentOne / WinUI Edition Topics
Posted by: munemoto on 14 July 2022, 5:43 pm EST
Posted 14 July 2022, 5:43 pm EST
When we start to edit in a cell, X is appear in right side.Replied 14 July 2022, 8:11 pm EST
Hi Tugu,
private void OnPrepareCellForEdit(object sender, GridCellEditEventArgs e)
{
if(e.Editor is TextBox texBox)
{
texBox.TextWrapping = TextWrapping.Wrap;
}
}
public class CustomTextBox : TextBox
{
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
var deleteButton = GetTemplateChild("DeleteButton") as Button;
var grid = VisualTreeHelper.GetChild(this, 0) as Grid;
grid.Children.Remove(deleteButton);
}
}
<c1:FlexGrid.Columns>
<c1:GridColumn Binding="Name">
<c1:GridColumn.CellEditingTemplate>
<DataTemplate>
<local:CustomTextBox Padding="7, 7, 0, 0"
Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></local:CustomTextBox>
</DataTemplate>
</c1:GridColumn.CellEditingTemplate>
</c1:GridColumn>
</c1:FlexGrid.Columns>
Marked as Answer
Replied 19 July 2022, 1:31 pm EST
Hi, Kartik