Show only one row, show all empty, each cell is a specific type of entry field.

Greetings,

Thank you for considering my question.

Currently, the design for the datagrid is the most efficient design method, in my case, for the type of information which is required to be entered on a daily basis for my users.  

As a point of reference, I have followed the tutorial Syncfusion has provided in the https://help.syncfusion.com/xamarin/datagrid/getting-started link step by step with no issues or concerns as your team has kindly illustrated.  

This control is quite amazing and my question is:  How may I show only one empty row where my users can select individual cells to input their data.  For instance, my current datagrid consists of eight columns and I'll give example names.  The columns are:

  • WorkDate                - I plan on using GridDateTimeColumn here
  • NameInput_1          - I plan on using GridComboBoxColumn here
  • NameInput_2          - I plan on using GridComboBoxColumn here
  • NameInput_3          - I plan on using GridComboBoxColumn here
  • NameInput_4          - I plan on using GridComboBoxColumn here
  • NumericInput_1      - I plan on using GridNumericColumn here
  • NumericInput_2      - I plan on using GridNumericColumn here
  • NumericInput_3      - I plan on using GridNumericColumn here
I have read in other forum posts here for other platforms that the datagrid needs to be bound to data and there could be a way to show the initial values as empty.  When the user selects the specific cell to input their data, they will then have the opportunity to choose their date, combobox value, and numeric values respectively.  I am just not sure how to write the code to show the values as empty upon initial user interaction with the datagrid control.  I'm wondering if you may have an example of this use case or if there was another user who may have had this similar request using Xamarin.Forms.

Is this possible?  Thank you again for considering my request and I really appreciate your time reviewing this.

3 Replies 1 reply marked as answer

KK Karthikraja Kalaimani Syncfusion Team March 30, 2021 09:31 AM UTC

Hi Noe,

Yes can show an empty cells by adding null value (Row) to your collection. So, the empty rows will show based on the index of the row in SfDataGrid. We have prepared sample for your requirement. Please download the sample from the below link.

 
Code snippet :

 
  mycollect = new ObservableCollection<Data>(); 
            for (int i = 0; i <= 0; i++) 
            { 
                mycollect.Add(new Data { No_1 = 10, No_2 = 20, Text = "MyAverage3" }); 
                mycollect.Add(null); 
            }


 
                            <syncfusion:SfDataGrid x:Name="dataGrid" AllowEditing="True" NavigationMode="Cell" SelectionMode="Single" MinimumHeightRequest="0"  AutoGenerateColumns="False" ItemsSource="{Binding mycollect}" ColumnSizer="Auto" AllowColumnSelection="True" AllowDraggingRow="True" AllowDraggingColumn="True" 
 
                              AllowResizingColumn="True" ScrollingMode="PixelLine" > 
 
                                <syncfusion:SfDataGrid.Columns> 
                                     
                <syncfusion:GridDateTimeColumn MappingName="OrderDate"></syncfusion:GridDateTimeColumn> 
                                    <syncfusion:GridTextColumn MappingName="No_1"></syncfusion:GridTextColumn> 
                                    <syncfusion:GridNumericColumn MappingName="No_2"></syncfusion:GridNumericColumn> 
                                    <syncfusion:GridTextColumn MappingName="No_1"></syncfusion:GridTextColumn> 
                                    <syncfusion:GridNumericColumn MappingName="No_2"></syncfusion:GridNumericColumn> 
                                    <syncfusion:GridTextColumn MappingName="No_1"></syncfusion:GridTextColumn> 
                                    <syncfusion:GridNumericColumn MappingName="No_2"></syncfusion:GridNumericColumn> 
                                    <syncfusion:GridTextColumn MappingName="No_1"></syncfusion:GridTextColumn> 
                                    <syncfusion:GridTextColumn MappingName="No_1"></syncfusion:GridTextColumn> 
                                    <syncfusion:GridNumericColumn MappingName="No_2"></syncfusion:GridNumericColumn> 
                                </syncfusion:SfDataGrid.Columns> 
                                 
 
                            </syncfusion:SfDataGrid> 
 
 


Regards,
Karthik Raja
 


Marked as answer

NL Noe Lopez III March 31, 2021 01:23 AM UTC

Greetings Karthik!

Many thanks to you and your team for providing me with the much needed assistance!  I am currently patching the code into my system and taking the time to learn and understand what you have shared with me.  I believe I can make it work since you gave me a helping hand and will be sure to report my findings soon with the final structure. Thanks!

Best regards,

Noé


KK Karthikraja Kalaimani Syncfusion Team March 31, 2021 07:22 AM UTC

Hi Noe,

Thanks for the update. We will wait hear from you.

Regards,
Karthik Raja
 


Loader.
Up arrow icon