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

InsertItem not work as expected

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Keith Heilveil
Top achievements
Rank 1
Keith Heilveil asked on 16 Dec 2008, 03:23 PM
I have a RadGrid with a Master/Detail relationship.
On the Master records, I have a button called "AddChild". When this is clicked, it fires the ItemCommand, with that name, and runs the following code to insert a child record

Dim

 

GridItem As GridDataItem = CType(e.Item, GridDataItem)

 

GridItem.ChildItem.NestedTableViews(0).InsertItem()

Unfortunately, this code only works if the Detail recordset already had records related to the master record. If there are no detail records related, The page refreshes but the RadGrid appears unchanged.

In the DetailTableDataBind, I am using ParentTableRelations to link the Master/Detail records up.

Any ideas how I can make this work as expected, and insert all of the time, instead of just when there are pre-existing detail records?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Keith Heilveil
Top achievements
Rank 1
answered on 17 Dec 2008, 03:15 PM
I found a workaround, as I believe this may be a feature.

If I show the headers (setting ShowHeadersWhenNoRecords="True"), it works correctly then.

Hope that tip helps someone.
Tags
Grid
Asked by
Keith Heilveil
Top achievements
Rank 1
Answers by
Keith Heilveil
Top achievements
Rank 1
Share this question
or