Single click too edit the datagrid cell.

Hi I have sfdatagrid template column containing cellTemplate and EditTemplate.

Now, whenever i click on a cell, first it selects that cell. then if i make on more click then it enter into edit mode.

How make the cell to enter into edit mode on first click itself?


One more issue regarding look,



each cell has cell template as label & edittemplate as entry control.

Now when the cell in is view mode (dark green color cell), the label is visible in center properly.

But when the cell enters into edit mode (Red color cell), the entry control is not visile properly. It's size  are shirked.

I need my entry control also looking similar to labels. How to resolve this issue?


4 Replies

LN Lakshmi Natarajan Syncfusion Team September 7, 2021 11:00 AM UTC

Hi Kishor, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported queries from our side. 
 
Query  
Response 
How make the cell to enter into edit mode on first click itself? 
The SfDataGrid supports you to enter into the edit mode by single tap by using the SfDataGrid.EditTapAction as OnTap. 
 
Please refer to our user guidance document regarding the same, 
 
I need my entry control also looking similar to labels. How to resolve this issue? 
Based on the screen shot provided, we assume that you are using Margin for both Label and Entry. In this case, when entering into edit mode, the selection is applied to the cell and the entry margin is considered within the selection border. 
 
To overcome the reported scenario, we recommend customizing the Entry with a smaller margin. 
 
Please refer to the following code snippets for more reference, 
<syncfusion:GridTemplateColumn HeaderText="OrderID" 
                        MappingName="OrderID"> 
    <syncfusion:GridTemplateColumn.CellTemplate> 
        <DataTemplate> 
            <Grid BackgroundColor="LawnGreen"> 
                <Label x:Name="changeValue" Text="{Binding OrderID}" TextColor="Black" BackgroundColor="Green" Margin="10" XAlign="Center" YAlign="Center"/> 
            </Grid> 
        </DataTemplate> 
    </syncfusion:GridTemplateColumn.CellTemplate> 
    <syncfusion:GridTemplateColumn.EditTemplate> 
        <DataTemplate> 
            <Grid> 
               <Entry Text="{Binding OrderID}" BackgroundColor="Red" Margin="{OnPlatform Default='10', Android='5'}" FontSize="15"/> 
            </Grid> 
        </DataTemplate> 
    </syncfusion:GridTemplateColumn.EditTemplate> 
</syncfusion:GridTemplateColumn> 
 
Screenshot: 
 
 
 
Please let us know if you need further assistance. 
 
Regards, 
Lakshmi Natarajan 
 



KI kishor September 7, 2021 01:54 PM UTC

Hi Thanks for the solution 2: Margin issue got resolved.


Problem 1 is still not yet resolved. : Double tap to edit cell value.

I have used the below code and still issue is not resolved.



I have a templated colum with below controls,

Label control as cell template

Entry control as edittemplate.


Still, whenever I click on a cell, first it selects/activates that cell. then if I make one more click then it enter into edit mode.

How make the cell to enter into edit mode on first click itself?





KK Karthikraja Kalaimani Syncfusion Team September 8, 2021 02:26 PM UTC

Hi Kishor, 

Thanks for the update. 

Currently, we are validating your requirement. We will validate and update the further details on or before 10th September 2021. We appreciate your patience until then. 

Regards,
Karthik Raja


RK Ranjith Kumar Durairaj Syncfusion Team September 10, 2021 08:11 AM UTC

Hi Kishor,

We have analyzed the reported query from our side. As the entry is integrated within a grid element, the focus has been set for the first element(which is grid) within the template and this is the expected behavior. So, we suggest you to directly integrate the entry within the template and set margin/padding to adjust the text within the entry. We have modified the sample for your requirement, and you can refer the same from below.
 

Sample link:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/GettingStarted-524176383

Video reference:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/20210910_130852780316770

Regards
Ranjith Kumar


Loader.
Up arrow icon