I set the Grid AutoGenerateColum to false and create 2 colum. When I set the datasource to my custom Dataset, I receive a error telling me that the Colum "nom" are alerady in the table...
Here is my code (sorry for the code directly in the post, but for a unkown reason I can't found the "add code" button in your post toolbar.
Dim Srch As New DirectorySearcher
Dim srchResultat As SearchResultCollection
Dim Resultat As SearchResult
'AJoute les colones
RadGridGroupes.MasterGridViewTemplate.AutoGenerateColumns =
False
Dim imgCol As New GridViewImageColumn
imgCol.UniqueName =
"Img"
imgCol.HeaderText =
""
imgCol.DataField =
"Img"
RadGridGroupes.MasterGridViewTemplate.Columns.Add(imgCol)
Dim txtCol As New GridViewTextBoxColumn
imgCol.UniqueName =
"Nom"
imgCol.DataField =
"Nom"
imgCol.Width = 200
imgCol.HeaderText =
"Nom"
RadGridGroupes.MasterGridViewTemplate.Columns.Add(imgCol)
Srch.Filter =
"(&(objectCategory=group))"
srchResultat = Srch.FindAll
Dim dtTable As New DataTable
Dim dtRow As DataRow
dtTable.Columns.Add(
New DataColumn("Img", System.Type.GetType("System.String")))
dtTable.Columns.Add(
New DataColumn("Nom", System.Type.GetType("System.String")))
dtTable.TableName =
"Groupes"
For Each Resultat In srchResultat
dtRow = dtTable.NewRow
dtRow.Item(
"Nom") = Resultat.Properties("name")(0)
dtTable.Rows.Add(dtRow)
Next
RadGridGroupes.DataSource = dtTable
End Sub