c# - Passing SelectedCells Information to another DataGrid on different page -


I have tried many things to solve this problem and I can not find the correct answer.

I have a DataGrid with 6 columns, and when users click on any row on Column 6 Should be redirected.

Enter image details here

then user can only click On any cell under the To-Do , when they click on that row, I want to find it for type , which in the same line as the cell is. If I click 6 to-do EG, then I should know that I click on line type football .

I want to send this type to the first column on the second page, so that I type that code under all the different To-Do I can bring item> Code>.

This is what I've tried:

  csViewEntity selected View = dgFake.SelectedItem as cSViewEntity; AllocateAudits Page = New Allocated () {DataContext = selectedView}; FrameNavigation.Navigate (Page);  

But when I did this, it does not affect this method:

  Public Zero Page_OnVigated (Object Sender, Navigation Event Order E) {var NewDataContext = e content; _View = (cSViewEntity) newDataContext; _Transactions = New list & lt; CAuditTransactionTypeEntity & gt; (); _Transactions = sp.GetTransactionTypes () ToList (); String transaction type = _View.TransactionType; Int transaction tapeid = _Transactions.FirstOrDefault (w = & gt; w.TransactionType == TransactionType). TransactionTypeId; DgAllocate.ItemsSource = sp.GetTransactionsNotEvaluated (TransactionTypeID) .Oolist (); }  

Any help would be very helpful,

thanks.

Answer to the question:

I passed the selected page to another page, then found the type on that page and ran a stored procedure on that type Given

  csViewEntity obj = (cSViewEntity) dgFake.SelectedItem; AllocateAudits Page = New Allocated Audits (OBJ) {DataContext = obj}; FrameNavigation.Navigate (Page); }  

and after that you pass it to the constructor and then you add it to the beginning of your method.

  Private Zero Raw (csViewEntity obj) {Var Transaction = _obj.TransactionType; // stores the information from the new datatytext in the unit with the name of _View _View = (cSViewEntity) obj; For the previous columns (column 6), I suggest you create a datagrid template.  

For example:

  Lt; DataGrade Name = "DG1" item resource = "{binding}" auto generated column = "false" & gt; & Lt; DataGrid.Columns & gt; & Lt; DataGridTemplateColumn Header = "To" & gt; & Lt; DataGridTemplateColumn.CellTemplate & gt; & Lt; DataTemplate & gt; & Lt; Button x: name = "MyNavigationButton" content = "{binding toDo}" click = "MyClickEvent" /> & Lt; / DataTemplate & gt; & Lt; /DataGridTemplateColumn.CellTemplate> & Lt; / DataGridTemplateColumn & gt; & Lt; /DataGrid.Columns> & Lt; / Data grid & gt;  

In the code behind, run MyClickEvent

  Private Zero MyClickEvent (Object Sender, EventArgs e) {var myBTndata = (Button) Sender) .DataContext; // here follows your code myBTNData}  

Hope this will get you started. You can also use other elements (such as hyperlinks)


Comments