Dinesh Kudale

Dinesh Kudale

  • NA
  • 127
  • 17.9k

DevExpress Gridcontrol shows empty column...

Sep 19 2019 8:04 AM
DevExpress Gridcontrol shows empty column after adding repositoryItemLookUpEdit.
I have created windows VB.Net application using 'Visual Studio Express 2015 for windows' with .Net Framework 4.6. In that I have used Devexpress 19.1.6.0 Gridcontrol on the form. I want to bind Student details to gridcontrol. In 'Name' column of gridview, I want to show combobox to select any Name to update particular cell.
For that purpose I have used repositoryItemLookUpEdit.
'Name' column must contain Name of sutdent. But when I will run the program, then 'Name' column shows empty cells. Why? How to overcome this issue?
Also If I will implement same program Without using repositoryItemLookUpEdit, then all column's correct data will get bind to the gridview and 'Name' column will also not showing empty.
Form1.vb
  1. Imports System.Data.SqlClient  
  2.   
  3. Public Class Form1  
  4.     Dim cn As SqlConnection = New SqlConnection("Data Source=PC161\SQLEXPRESS;Database=Student;Integrated Security=true")  
  5.     Dim da As New SqlDataAdapter  
  6.   
  7.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load  
  8.         LoadGrid()  
  9.     End Sub  
  10.   
  11.     Private Function FetchAllDetails() As DataTable  
  12.         Dim dt As New DataTable  
  13.         da = New SqlDataAdapter("select * from StudentInfo", cn)  
  14.         da.Fill(dt)  
  15.         Return dt  
  16.     End Function  
  17.   
  18.     Private Function FetchIdName() As DataTable  
  19.         Dim dt As New DataTable  
  20.         da = New SqlDataAdapter("select ID, NAME from StudentInfo", cn)  
  21.         da.Fill(dt)  
  22.         Return dt  
  23.     End Function  
  24.   
  25.     Private Sub LoadGrid()  
  26.         Try  
  27.             GridControl1.DataSource = FetchAllDetails()  
  28.             RepositoryItemLookUpEdit1.DataSource = FetchIdName()  
  29.             RepositoryItemLookUpEdit1.ValueMember = "ID"  
  30.             RepositoryItemLookUpEdit1.DisplayMember = "NAME"  
  31.             RepositoryItemLookUpEdit1.NullText = ""  
  32.             RepositoryItemLookUpEdit1.PopulateColumns()  
  33.         Catch ex As Exception  
  34.             MessageBox.Show(ex.Message)  
  35.         End Try  
  36.     End Sub  
  37. End Class  
 In-place Editor Repository option to add RepositoryItemLookupEdit
 
 
 
Added columns after click on Run Design option on Gridcontrol
 
 
 
 Form1_Design
 
 Output window after click on cell
 
 
 
 Output_after_running_the_project
 

Answers (2)