I am trying to change the value of a cell in my grid
The xaml is as follows:
The code to populate the grid is:
The TransactionTypeId will be either 11 or 12,
If TransactionTypeId == 11, then I want to display "Rental" in the Type field
if TransactionTypeId == 12 then I want to display "Sales" in the Type field
Also, I want the row to be background color red if TransactionTypeId = 11, and I want the row to be yellow if TransactionTypeId = 12
What would be the best way that I could accomplish this?
The xaml is as follows:
<
telerik:RadGridView
AutoGenerateColumns
=
"False"
Margin
=
"12,0,12,12"
Name
=
"radGridViewNeedsShipping"
SelectionMode
=
"Extended"
ShowGroupPanel
=
"False"
Height
=
"190"
VerticalAlignment
=
"Bottom"
MouseDoubleClick
=
"rgvOpenTicket"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"PO Number"
IsReadOnly
=
"True"
UniqueName
=
"SerialNumber"
/>
<
telerik:GridViewDataColumn
Header
=
"Customer"
IsReadOnly
=
"True"
UniqueName
=
"Customer.EntityName"
/>
<
telerik:GridViewDataColumn
Header
=
"Ship By Date"
IsReadOnly
=
"True"
UniqueName
=
"TransactionDate"
DataFormatString
=
"{}{0:MM/dd/yyyy}"
/>
<
telerik:GridViewDataColumn
Header
=
"Type"
IsReadOnly
=
"True"
UniqueName
=
"TransactionTypeId"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
The code to populate the grid is:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
radGridViewNeedsShipping.ItemsSource = InControlDataAccess.getTransactions(0).Where(i => (i.TransactionTypeId == 11 || i.TransactionTypeId == 12) && (i.HasBeenShipped == null || i.HasBeenShipped == false) && i.InProgress != null && i.InProgress != false).OrderBy(i => i.Id);
}
The TransactionTypeId will be either 11 or 12,
If TransactionTypeId == 11, then I want to display "Rental" in the Type field
if TransactionTypeId == 12 then I want to display "Sales" in the Type field
Also, I want the row to be background color red if TransactionTypeId = 11, and I want the row to be yellow if TransactionTypeId = 12
What would be the best way that I could accomplish this?