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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add empty row un SfDataGrid for data entry

Thread ID:

Created:

Updated:

Platform:

Replies:

148953 Nov 8,2019 02:36 PM UTC Nov 13,2019 05:27 AM UTC WPF 5
loading
Tags: SfDataGrid
Carlos
Asked On November 8, 2019 02:36 PM UTC

Hi there!

How could I do so SfDataGrid can have an empty row for data entry? I want one of the columns to be a combobox and the others just simple textboxes.

As far as I know, SfDataGrid in WPF needs to have a data binding unlike to WINFORMS that you can add columns without binding data to something.

In WINFORMS, I'm able to add columns and set the Allow AddRows property to start entering data using textbox and combobox column. How can I do the same practice

with SfDataGrid?

Thanks in advanced.

C.

Shobika Palani [Syncfusion]
Replied On November 11, 2019 12:30 PM UTC

Hi Carlos,   
  
Thank you for contacting Syncfusion Support.   
  
SfDataGrid has built-in support to add new rows to the underlying collection. You can allow the addition of new rows in datagrid by specifying AddNewRowPosition. Please refer the below UG link.   
  
UG Link:     
  
Also please refer to our Dashboard sample for AddNewRow feature in the below location.  
  
DashBoard Installation Location:    
{InstalledLocation}\Syncfusion\WPF\{installed version}\SfGrid.WPF\Samples\AddNewRowDemo/CS    
   
Github location:    
   
If we have misunderstood your requirement, please get back to us with more details regarding your requirement.    
  
Regards,   
Shobika  


Carlos
Replied On November 11, 2019 06:37 PM UTC

Thanks Shobika for your reply.

As I saw the link you provided, looks like it is mandatory to bind a collection to the SfDataGrid to add rows.

Is there a way to add rows without binding the control to a collection like I used to do it in WINFORMS?

Regards,
C.

Shobika Palani [Syncfusion]
Replied On November 12, 2019 12:38 PM UTC

Hi Carlos,   
  
By default, SfDatagrid is a data bounded grid and without binding collection, you cannot add rows directly to the grid. It is because we processed the creation of view based solely on the bounded collection. However, you can set empty collection as the itemssource for datagrid and then add item to the grid to fulfill your requirement. For adding new rows.  
  
Please refer the below KB.   
  
KB Link:   
  
Please let us know, if you require any further other assistance on this.   
  
Regards,   
Shobika  


Carlos
Replied On November 12, 2019 03:54 PM UTC

Thank you! It was very helpful. I had a hesitate thinking I was able to add rows without a binding collection but now you clarified to me.

Feel free to close this ticket.

Thanks again!

Farjana Parveen Ayubb [Syncfusion]
Replied On November 13, 2019 05:27 AM UTC

Hi Carlos, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
  
Regards, 
Farjana Parveen A 


CONFIRMATION

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