We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem Cancelling AddNewRow And Masking Grid Column

Thread ID:





151233 Feb 4,2020 04:18 PM UTC Feb 5,2020 02:19 PM UTC WinForms 2
Tags: SfDataGrid
Asked On February 4, 2020 04:18 PM UTC

Hi Syncfusion Team,

I tried the following link and the example provided for using Reflection in refreshing the grid but it is not working.

I have the same requirements, when you press ESCAPE key, it will cancel the current line and should show 'Click here to add...'
Right now, the provided example is showing a blank grid.  See attached screenshot.

Using VS2019 Enterprise and WF

How can I use masking in GridTextColumn?
Or any other way to mask a column?

Input: 12120202
Masking: 12-12-0202


Attachment: Grid_Screenshot_a2f14985.zip

Replied On February 5, 2020 12:27 PM UTC

Hi Syncfusion,

No possible solution yet to the questions?


Saravanan Ayyanar [Syncfusion]
Replied On February 5, 2020 02:19 PM UTC

Hi ER, 
Thank you for using Syncfusion controls. 
Query 1: 
We are prepared the sample for your requirement of “when press Escape key, it will cancel the current line and should show ‘Click here to add…’ ”. Please find the sample link below. 
Sample Link: 
Query 2: 
You can achieve your requirement of “masking in GridTextColumn” by using the SfDataGrid.DrawCell event. Please refer the code snippet below. 
this.sfDataGrid1.DrawCell += SfDataGrid1_DrawCell; 
private void SfDataGrid1_DrawCell(object sender, Syncfusion.WinForms.DataGrid.Events.DrawCellEventArgs e) 
         string str1=e.DisplayText; 
         string str2 = string.Empty; 
         for(int i=0;i<str1.Length;i++) 
             str2 += str1[i]; 
             if (i == 1 || i == 3) 
                 str2 += "-"; 
         e.DisplayText = str2; 
Sample Link: 
Please let us know, if you require further assistance on this. 
Saravanan A. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon