- Home
- Forum
- Xamarin.Forms
- Datagrid kyboard
Datagrid kyboard
When i inset data in the gird i have to confrim twice the data inserted.
I have atttached the images of two keyboard that are different only for the confirm button, is there a way to have only one confirmation?
Ans also, after i click the button the keyboard disapper but seems the cell iis in edit mode,is there a way to validate the data instead of tap outside of that cell?
All the sequenca is in the image.
Thanks in advance,
Alberto C.
SIGN IN To post a reply.
4 Replies
SK
Shivagurunathan Kamalakannan
Syncfusion Team
July 3, 2018 01:59 PM UTC
Hi Alberto,
Thanks for contacting Syncfusion Support,
Regarding this query: “I have atttached the images of two keyboard that are different only for the confirm button, is there a way to have only one confirmation?”
Can you please confirm once on your side that the screenshots has been attached to this update, since we could not able to find the screenshots on our end.
Regarding this query: “Ans also, after i click the button the keyboard disapper but seems the cell iis in edit mode,is there a way to validate the data instead of tap outside of that cell?”
You can achieve SfDataGrid. EndEdit by tapping the “ENTER” key in SfDataGrid, This can be achieved by customizing the SfDataGrid. CurrentCellBeginEdit event.
Please refer the below code for reference:
|
public partial class MainPage : ContentPage
{
int currentRowIndex = -1;
public MainPage()
{
InitializeComponent();
dataGrid.CurrentCellBeginEdit += DataGrid_CurrentCellBeginEdit;
}
private async void DataGrid_CurrentCellBeginEdit(object sender, GridCurrentCellBeginEditEventArgs args)
{
await Task.Delay(100);
var row = dataGrid.GetRowGenerator().Items.FirstOrDefault(x => x.RowIndex == args.RowColumnIndex.RowIndex);
currentRowIndex = args.RowColumnIndex.RowIndex;
var column = (row.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name == "VisibleColumns").GetValue(row) as List<DataColumnBase>).FirstOrDefault(x => x.ColumnIndex == args.RowColumnIndex.ColumnIndex);
if (((column as IElement).Element as ContentView).Content is Entry)
{
(((column as IElement).Element as ContentView).Content as Entry).Completed += Entry_Completed;
}
}
private async void Entry_Completed(object sender, EventArgs e)
{
dataGrid.EndEdit();
await Task.Delay(500);
this.dataGrid.SelectedIndex = currentRowIndex;
}
}
|
We have prepared a sample based on your requirement and you can download the same from below link.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/SfGrid_Sample1659822822
Regards,
Shivagurunathan
AL
Alberto
July 3, 2018 02:07 PM UTC
You should find a dile name sequence attached to the answer.
AL
Alberto
July 3, 2018 02:46 PM UTC
I have tested the code but i have this type SfNumericTextBox insetad of Entry so i have null exception if i continue.
Alberto C.
SK
Shivagurunathan Kamalakannan
Syncfusion Team
July 6, 2018 02:21 PM UTC
Hi Alberto,
We could not able to find the screenshots on our end. Can you please confirm that you have uploaded the screenshots using the direct trac system.
We have checked your query, NullRefrence Exception while using SfNumericTexBox could not be reproduce on our side. Can you please provide us any of the following details so that we could able to reproduce the issue.
• What are the settings applied to SfDataGrid and its container?
• Can you please provide us the stack trace for the exception.
• If possible can you please share us the Xaml page?
We have provided the sample which we have tested and you can download from the below link.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/SfGrid_Sample-641523787
We have also provided a video which shows that the sample does not throw NullReferenceException on our side and you can download it from the below link.
Video sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/SampleVideo_-_converted_with_Clipchamp-389150014
Regards,
Shivagurunathan
SIGN IN To post a reply.
- 4 Replies
- 2 Participants
-
AL Alberto
- Jul 2, 2018 03:17 PM UTC
- Jul 6, 2018 02:21 PM UTC