So, I figured out how to create the Child grid int he code behind, but now I need to have a click event on the Child grid rows. With the following code I get a "Handler type is mismatched" on the order.AddHandler line.
Any help on how to get this to work?
Thanks,
Doug
Any help on how to get this to work?
Thanks,
Doug
private void rgvPatientImages_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e) { GridViewDataControl dataControl = (GridViewDataControl)sender; if (dataControl.ParentRow != null) { dataControl.BorderThickness = new Thickness(0, 1, 0, 1); dataControl.GridLinesVisibility = GridLinesVisibility.None; dataControl.CanUserFreezeColumns = false; dataControl.ShowGroupPanel = false; dataControl.AutoGenerateColumns = false; dataControl.ChildTableDefinitions.Clear(); dataControl.IsReadOnly = true; dataControl.SelectionMode = SelectionMode.Single; dataControl.SelectionUnit = GridViewSelectionUnit.Cell; GridViewDataColumn customerId = new GridViewDataColumn(); customerId.Header = "Customer Id"; customerId.DataMemberBinding = new Binding("CustId"); customerId.DataType = typeof(int); dataControl.Columns.Add(customerId); GridViewDataColumn order = new GridViewDataColumn(); order.UniqueName = "OrderIdId"; order.Header = "Order Id"; order.DataType = typeof(int); order.AddHandler(MouseLeftButtonDownEvent, new EventHandler<MouseButtonEventArgs> (orderId_MouseLeftButtonUp)); dataControl.Columns.Add(order); }} private void orderId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { object ID = ((Button)sender).CommandParameter; CustomerOrder NewWindow = new CustomerOrder(); NewWindow.orderId = Convert.ToInt32(sender.ToString()); NewWindow.Show(); this.Close(); }