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
4970
xamGrid databinding problem
posted

In UserControl xaml, set itemsource binding as:

ItemSource ="{Binding MyList}"

MyList is loaded in ViewModel by Ria Service. VM has Loaded event. In UserControl code-behind, hook up Loaded event as:

 void vm_Loaded(object sender, EventArgs e)
 {
    this.MyXamGRidd.Rows[0].IsSelected = true;
 }

The purpose of above code is auto selecte the first row when data is loading.

Run the application, I got error for code     this.MyXamGRidd.Rows[0].IsSelected = true;. It said null object because this.MyXamGRidd.Rowsis null. but when dubug the app for this line of code. Data did loaded at this time.

How to resolve this problem?

Parents Reply Children
No Data