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
close icon

Add empty records in Griddataboundgrid

Hello,

I was wondering if it was possible to add empty records to a griddataboundgrid. The purpose is to fill up the empty grid space with empty records, when there is by example one record specified in the grid.

Thanks in advance,

Gunther


3 Replies

JJ Jisha Joy Syncfusion Team November 18, 2008 05:30 AM UTC

Hi Gunther,

You do not have to fill in everything. All you have to do is call:



DataRow dr = dt.NewRow();
dt.Rows.Add(dr);





That is it. That adds any empty row. You are free to populate whatever field you want to populate, 1 field, 2 fields, all fields or no fields.



If your datasource is not a datatable, then you still do the same thing. You create a new item for your IBindingList collection, and then you add it to the collection.



So, the question is: Can you add a new item to the datasource and populate what you want populated? This has nothing to do with the grid, it is all about the nature of your datasource.

Thank you for using Syncfusion products.

Regards,
Jisha




GD Gunther Devisch November 18, 2008 11:59 AM UTC

Hey Jisha,

Indeed, stupid of me! I wasn't thinking so far.

Thanks for the solution!

Gunther



AD Administrator Syncfusion Team December 5, 2008 03:02 PM UTC

Hey,

I was wondering if there is property for filling up the griddataboundgrid with empty records, because with i'm having problems adding empty datarows to the datatable, duo to my rowfilter i think.

Thanks,
Gunther

>Hey Jisha,

Indeed, stupid of me! I wasn't thinking so far.

Thanks for the solution!

Gunther




Loader.
Live Chat Icon For mobile
Up arrow icon