jeudi 4 septembre 2014

OnCelldouble click in my gridview


Vote count:

0




I need to double click the cell in my gridview and whenever I click it, it should open a new window to edit the value. However, on my codes, it return to null even if i have a value. I think the event handler for my gridview is incorrect. Heres is the message "Object reference not set to an instance of an object."


Here's is my code..


Constructor:



grdProducts.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRoutedEventArgs>(OnCellDoubleClick), true);


Click Events:



private void OnCellDoubleClick(object sender, RadRoutedEventArgs e)
{
Product product = (sender as Telerik.Windows.Controls.GridViewColumn).DataContext as Product;
ShowProductWindow(product);

//MessageBox.Show("test");
}


Help me to figure it out. Thanks :)



asked 16 secs ago

Kim

11






OnCelldouble click in my gridview

Aucun commentaire:

Enregistrer un commentaire