This is a migrated thread and some comments may be shown as answers.

alter column text based on another column

4 Answers 48 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 02 Jun 2011, 03:43 PM
I have a radgridview with two columns one bound to data and one unbound.
I want to set the cell on the unbound column to the text on the bound column but via some code ( example upper case the text, but could be any code )
Thus
Jimmy   JIMMY
Alan      ALAN
Fred      FRED

I tried playing with the row loaded event but could not seem to alter the text.
Suggestions please
Thanks
Jim

4 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 02 Jun 2011, 04:02 PM
Hello Jim,

I have prepared an example project using a converter. It is quite a simple one, but utilizing this approach you can execute much more complex custom logic than just converting string to upper case.

Greetings,
Ivan Ivanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jim
Top achievements
Rank 1
answered on 02 Jun 2011, 04:09 PM
Sound good I will investigate.
Most times people just need pointing in the right direction.
Regards
Jim
0
Jim
Top achievements
Rank 1
answered on 08 Jun 2011, 03:53 PM

Similar to what I want but I wanted to do it on a row basis.
Typically in the celledit ended I want to set the next field in the row.
I tried this

Private Sub dgrLandrulecode_CellEditEnded(sender As System.Object, e As Telerik.Windows.Controls.GridViewCellEditEndedEventArgs) Handles dgrLandrulecode.CellEditEnded
    Dim cell As GridViewCell = e.Cell
    Dim row As GridViewRowItem = cell.ParentRow
    Dim lrc As Landrulecode = DirectCast(row.Item, Landrulecode)
    lrc.Servicedescription = "Wibble"
    lrc.ServiceTypeCode = "Fred"
    Dim x As Integer = 0
End Sub

Now ServiceTypeCode was the cell I edited and yes that does change to "Fred"
But Servicedescription  is the next field along and does not change to Wibble.
It's like it was read only or not editable ???
Can I do this or am I going about this completely wrong ?
JL


0
Ivan Ivanov
Telerik team
answered on 10 Jun 2011, 03:25 PM
Hi Jim,

Using this approach, the RadGridView is not notified of any other changes than setting the property respective to the edited cell. In order to make it work,  you may try implementing INotifyPropertyChanged on your business object class.

All the best,
Ivan Ivanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Jim
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Jim
Top achievements
Rank 1
Share this question
or