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

GridBoundColumn Condition

1 Answer 78 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Den
Top achievements
Rank 1
Den asked on 13 Nov 2008, 01:57 AM

I am looking for a way to take a data and reformat based on the condition.

how do I use the condition in GridBoundColumn or GridCalculatedColumn?
ex.

 if boundColumn.DataField.text > 1 then
 DataField.text = "> {0}"
 else
 DataField.text = "< {0}"
 end if

Thanks

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 13 Nov 2008, 07:10 AM
Hello Den,

I suggest you try the following approach:
Protected Sub RadGrid1_ItemDataBound(ByVal sender As ObjectByVal e As GridItemEventArgs) 
    Dim item As GridDataItem = TryCast(e.Item, GridDataItem) 
    If item <> Nothing Then 
        Dim celltext As String = item("ProductName").Text 
        item("ProductName").Text = String.Format("[ {0} ]", celltext) 
    End If 
End Sub 

Let us know if you need more information.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Den
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or