Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
380
How to set default value of cell when adding a new record
posted

We bind   BindingList<T>  to  XamDataGrid.DataSourceProperty, and add a new event to

BindingList’s AddingNew  like  following:

BindingListData.AddingNew += new AddingNewEventHandler(OnAddingNew);

The OnAddingNew function, we create T (the row data) and set e.NewObject =  newly created  T like following:

void OnAddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)

{

Create T;

e.NewObject = newly created T;

}

when user enters a character in any cell on the top row OnAddingNew () is called. The created row is already added to the binding list.

Our question is we have already set the default value of cell in the T’s constructor, why  the cell of new row is still blank? We have set  two  way binding  for the field, but the new record on the top seems like one way binding,.

 

Anyone give some idea about how to solve  this problem

 

Parents Reply Children
No Data