This is a migrated thread and some comments may be shown as answers.

Issue when adding a row to a datatable bound to a RadGridView set with self referencing hierarchy

1 Answer 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gary H
Top achievements
Rank 1
Gary H asked on 25 Jan 2012, 07:54 PM
Hi there,
    I have a datatable that I am using as the source of my datagrid. The datagrid is a self referencing hierarchy. When I add a row to the datatable, it does not appear in the grid. If I add a second row, or click around in the grid it appears. It is as though the grid is not being repainted. I need to mention that this grid allows for drag and drop from another grid.

Code under my add button:

nCount += 1

 


Dim
dr As DataRow

 

dr = dtTable2.NewRow

dr("Item Number") = nCount
dr(
"ParentItem") = 0

dr("Item Desc") = ""

dr("Quantity") = 0

dr("UOM") = ""

dr("Vendor") = ""

 

dtTable2.Rows.Add(dr)

 

dgBOM.DataSource = dtTable2

 

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Julian Benkov
Telerik team
answered on 30 Jan 2012, 01:02 PM
Hi Gary,

You can use the Refresh method of GridViewTemplate to refresh the data in your self-reference scenario.

radGridView1.MasterTemplate.Refresh()

If you continue to experience the issue, please send us a simple project with some part of your data to investigate the issue locally. Thank you for your cooperation.

Please note that you have to open a new support ticket in order to be able to attach your files.

Greetings,
Julian Benkov
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

Tags
GridView
Asked by
Gary H
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or