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

[Solved] RadGridView insert row

1 Answer 296 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
KOG
Top achievements
Rank 1
KOG asked on 20 Jan 2010, 04:37 AM
Can the RadGridView have rows inserted through the .vb/.cs code behind without identifying the ItemSource in the xaml layer?

We're able to show one row in a grid which lives inside of a Telerik tab control. When we try to update the ItemsSource in a routine we're not seeing a new row. The code is:

Private Sub InsertNewFunding(ByRef oTrainingControl As smTraining)

      Dim addNewFunding As New OurSL.OurServiceReference.TrainingFunding

      oTrainingControl.OurTrainingFundingList.Add(addNewFunding)

      oTrainingControl.grdCostContribution.ItemsSource = oTrainingControl.OurTrainingFundingList

End Sub

Can this be done without mentioning Binding and ItemsSource in the xaml layer?

Thanks.

KOG

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 22 Jan 2010, 03:05 PM
Hello KOG,

To work correctly RadGridView needs ItemsSource property. It can be defined either in Code behind or Xaml code.
In the attachment you  will find sample project demonstrating how you can add items to your collection.

If your collection implements ICollectionNotifyChanged you don't need to set the itemsSource again - Rad grid view will automatically refresh its rows.

Sincerely yours,
Tsvyatko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
KOG
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or