This question is locked. New answers and comments are not allowed.
I have a Grid connected to a SQL Table. I am displaying the data via a WCF service. I have a column in my SQL Table labeled "NASSync" The Column is set to type "int" and has a value of either 0 or 1 in the Table. I have referenced it in the WCF Service as below,
Imports System.ServiceModel Imports System.ServiceModel.Activation Imports System.Collections.Generic Imports System.Data Imports System.Data.SqlClient Imports SilverlightWithWCFService.Web <ServiceContract(Namespace:="Web"), AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _ Public Class SampleService <OperationContract()> _ Public Function GetList() As List(Of AcxiomDBCallInfo) Dim nwConn As String = System.Configuration.ConfigurationManager.ConnectionStrings("AcxiomConnectionString").ConnectionString Dim checkList = New List(Of AcxiomDBCallInfo)() Using conn As New SqlConnection(nwConn) Const sql As String = "SELECT Hostname, NAS_Sync FROM CheckListItemss"conn.Open() Using cmd As New SqlCommand(sql, conn) Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection) If dr IsNot Nothing ThenDo While dr.Read() Dim data = New AcxiomDBCallInfo With {.Hostname = dr.GetString(0), .NASSync = dr.GetBoolean(1)} checkList.Add(data) LoopEnd IfReturn checkList End Using End Using End Function' Add more operations here and mark them with [OperationContract] End ClassWhen I run the SilverLight application I see the following in the Grid,
Hostname NasSync
blahblah True
blahblah2 True
blahblah3 False
I want the NasSync Column to be a checkbox column and be check or unchecked depending on the value of the .NasSync Property.
How do I do this?
This is how the gridview is currently being populated,
Private Sub client_GetListCompleted(ByVal sender As Object, ByVal e As GetListCompletedEventArgs) TaskGrid.ItemsSource = e.Result End Sub
Thanks,
Tim