How can I put a Silverlight 3 DataGridCell into edit mode in code? -


I want to take a specific cell in a Silverlight 3.0 datagreat and in edit mode. I can use VisualTreeManager to locate the cell. How do I switch to editing mode?

Every DataGridSell looks like this in VisualTreeManager:

  System.Windows.Controls.DataGridCell System.Windows.Controls.Grid System.Shapes.Rectangle System.Windows. Controls.ContentPresenter System.Windows.Controls.TextBlock System.Windows.Shapes.Rectangle System.Windows.Shapes.Rectangle  

I want to edit the text block containing the text.

Update

@ Follow Anthony Wygens's suggestion, here's what I'm trying to get started (BeginEdit).

I wanted to keep it simple so I thought I wanted to select a column in the first line. Even proven beyond my SL knowledge! Finally, I get the first line by creating a field called the first row, to catch it:

  Private datagraders are already used;  

and

  Private Zero ComputerDataGrid_loadingRow (Object Sender, DataGridRoEventErgus E) {If (this: firstly == empty) this. First rau = ero; }  

and then adding a button to the panel to trigger the edit:

  Private Zero Button_Click (Object Sender, RoutedEventArgs e) {this .dataGrid SelectedItem = this.firstRow; This.dataGrid.CurrentColumn = this.dataGrid.Column [4]; This.dataGrid.BeginEdit (); }  

I click on the button and the correct cell is selected, but it does not go into editing on the cell. It takes manual clicks to achieve

I'm not sure that you have the DataGridcel using VisualTreeManager nor am I currently aware that you How to properly start editing you can just remove the view position of the cell to edit.

  VisualStatizer. GoToState (myDataGridCell, "edit", true);  

I'm not sure how the grid behaves when you do something like the above, if you need a datagrid to help you return the changes in a row So you can parse some things.

"Standard" approach DataGrid must set selectedItem property represented by row, CurrrentColum property to DataGridColumn set for the object, which is found in the column in the cell. Then call the BeginEdit method.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -