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

[Solved] WCF Service call during Cell Loaded Event

1 Answer 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Timothy
Top achievements
Rank 1
Timothy asked on 13 Feb 2011, 09:01 AM
I have a requirement to call a WCF Service and ping an IP Address which is equal to the current cell.value that is being loaded. The call to the service is below,

Private Sub CheckListItemssDataGrid_CellLoaded(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.GridView.CellEventArgs) Handles CheckListItemssDataGrid.CellLoaded
       If TypeOf e.Cell Is GridViewCell Then
           Dim Row As GridViewRow = e.Cell.ParentOfType(Of GridViewRow)()
           Dim Hostname = TryCast(Row.Cells(0), Telerik.Windows.Controls.GridView.GridViewCell)
           HostnameValue = Hostname.Value.ToString
               client.ping(HostnameValue)

The Ping return value (True or False) is evaluated in a seperate sub routine (Ping Completed Routine). However I need to color the cell background red or white depending on the service call result (True of False). How can I do this if I have to leave the cell loaded routine in order to evaluate the return value of the service call?

Proble: Once I leave the cell loaded event I lose my ability to reference the current cell that was just loaded and this prevents me from painting the cell background.

Please help.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Feb 2011, 08:55 AM
Hello,

 It will be better to implement this at your data level - property getter for example. When the service returns data you can raise PropertyChanged (your objects should be INotifyPropertyChanged) and in this case your RadGridView with defined CellStyleSelector will react immediately. 

All the best,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Timothy
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or