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

Inserting rows

I have 3 functions i was using with `DataGridView` and when switching over to `GridDataBoundGrid` these functions no longer work and i cant seem to understand why



7 Replies

MG Mohanraj Gunasekaran Syncfusion Team September 12, 2017 01:45 PM UTC

Hi Joseph, 

Thanks for using Syncfusion product. 

We can understand your scenario. In DataGridView, RowIndex(0) has considered from first record row but GridDataBoundGrid has considered the RowIndex(0) from column header. So, if you want to add the new row after/ before based on the current row index, please make use of the below code and refer the attached sample, 

Code example 
GridDataBoundGrid grid = this.tabControl1.SelectedTab.Controls.OfType<GridDataBoundGrid>().First(); 
//Insert after 
index = grid.CurrentCell.RowIndex; 
 
//Insert before 
index = grid.CurrentCell.RowIndex - 1; 
 
DataRow dr = ds.Tables[tabindex].NewRow(); 
ds.Tables[tabindex].Rows.InsertAt(dr, index); 
 
 
Sample link: GridDataBoundGrid 
 
Note:   
Moreover, you can use the GridGroupingControl instead of GridDataBoundGrid. GridGroupingControl has more features and support. It is used to display the binding source with more flexible manipulation like sorting, grouping, filtering.  
 
Please let us know, if you have any concerns. 
 
Regards, 
Mohanraj G 
 



JW Joseph Williamson September 12, 2017 11:21 PM UTC

I must say this software is highly disappointing after using telerik I'm just very disappointed at how horrible this add on is 



MG Mohanraj Gunasekaran Syncfusion Team September 13, 2017 02:35 PM UTC

Hi Joseph,  
 
Sorry for the inconvenience caused. 
 
In our GridDataBoundGrid, we have calculated the row and column index based on the visible cells. So, if you want to add the new row before/after the current row using bounded collection(DataTable), you should calculate the row index using below code. This is our current architecture of GridDataBoundGrid. 
 
Code example 
//Insert Row before 
int count = this.gridDataBoundGrid1.ShowColumnHeaders ? 1 : 0; 
index = grid.CurrentCell.RowIndex - count; 
 
 
Screenshot 
 
 
 
Please let us know, if you facing any other difficulties to use our GridDataBoundGrid. 
 
Regards, 
Mohanraj G 
 



JW Joseph Williamson September 14, 2017 03:33 PM UTC

When I downloaded syncfusion I was looking for something visually appealing like teleriks RadGridView out of the box however syncfusion doesn't have any gridviews that are visually appealing out of the box plus telerik their RadGridView works directly with all my functions that were made for DataGridView so I believe I'm gonna be uninstalling syncfusion but thand anyways



MG Mohanraj Gunasekaran Syncfusion Team September 15, 2017 02:15 PM UTC

Hi Joseph, 
 
Sorry for the inconvenience caused. 
 
Query 
Solution 
 visually appealing like teleriks RadGridView out of the box however syncfusion doesn't have any gridviews that are visually appealing out of the box 
GridDataBoundgrid having more appearance which can be achieved by using GridVisualStyles property. Please refer to the below code example, 
 
The following appearances are available for GridDataBoundGrid, 
  • Metro
  • Office2003Black
  • Office2007Black
  • Office2007Blue
  • Office2007Silver
  • Office2010Black
  • Office2010Blue
  • Office2010Silver
 
Code example 
this.gridDataBoundGrid1.GridVisualStyles = GridVisualStyles.Metro;  
 
Please let us know what kind of appearance do you want for the  GridDataBoundGrid 
 
Note: 
This support also available for GridGroupingControl. Please refer the below UG link, 
 
telerik their RadGridView works directly with all my functions that were made for DataGridView so I believe I'm gonna be uninstalling syncfusion but thand anyways 
We have provided the solution based on our GridDataBoundGrid current architecture. We are maintaining the column header in index due to maintaining the all visible cellstyles and Visible cells details. So, this is our default behavior and we cannot change this behavior. 
 
 
 
Regards, 
Mohanraj G 



JW Joseph Williamson September 16, 2017 06:04 AM UTC

Your reply is much appreciated after looking over the styles I am very pleased with the outcome(maybe this should be mentioned more in the docs) I am still not happy about the functionality but I believe I may be able to put up with it now :)


While here perhaps you can provide a solution for this issue as well...

https://stackoverflow.com/questions/46124436/synfusion-winforms-griddataboundgrid-what-events-are-they-for-detecting-header




MG Mohanraj Gunasekaran Syncfusion Team September 18, 2017 01:04 PM UTC

 Hi Joseph,  
 
Sorry for the inconvenience caused. 
 
GridDataBoundGrid has marked as a classic control. Since the GridDataBoundGrid is classic control, the development is no longer for this control was not provided. So, that we have suggested to use the GridGroupingControl for your requirements. You can use the GridGroupingControl instead of GridDataBoundGrid. GridGroupingControl have more features and support compare than GridDataBoundGrid(Classic). And, GridGroupingControl has proper documentation for all features and support. Please refer the following UG links, 
 
 
Note: 
We have considered your feedback and we will update our documentation for GridDataBoundGrid(Classic). It will be available on any of our upcoming release. 
 
Please let us know, if you have any concerns. 
 
Regards, 
Mohanraj G 
 
 
 


Loader.
Live Chat Icon For mobile
Up arrow icon