Tampilkan postingan dengan label LookUpEdit. Tampilkan semua postingan
Tampilkan postingan dengan label LookUpEdit. Tampilkan semua postingan

hide devexpress lookup column

Posted On // Leave a Comment
I try to use SQLServer Stored Procedure to load DataTable into DevExpress LookupEdit. Here's the syntax:

Dim dtTipe As New DataTable

        With _SqlCommand

            .CommandText = "mstTipe_SELECT_id_Nama_WHERE_Merek_Honda"

            .Parameters.Clear()

            _SQLReader = .ExecuteReader

        End With

        dtTipe.Load(_SQLReader)

        With lookupTipe

            .Properties.DataSource = dtTipe

            .Properties.ValueMember = "Nama"

            .Properties.DisplayMember = "Nama"

            .Properties.PopupWidth = 250

        End With

        _SQLReader.Close()


the result of syntax above is:












The problem is, I want to hide the "ID" column because user don't care about it.

Here's the two lines addition code to hide the "ID" column


  Dim dtTipe As New DataTable
        With _SqlCommand
            .CommandText = "mstTipe_SELECT_id_Nama_WHERE_Merek_Honda"
            .Parameters.Clear()
            _SQLReader = .ExecuteReader
        End With
        dtTipe.Load(_SQLReader)
        With lookupTipe
            .Properties.DataSource = dtTipe
            .Properties.PopulateColumns()
            .Properties.Columns("ID").Visible = False
            .Properties.ValueMember = "Nama"
            .Properties.DisplayMember = "Nama"
            .Properties.PopupWidth = 250
        End With
        _SQLReader.Close()













You can't hide the column before populate it. So, all you have to do is populate the colum then you can set visibility to false.
[Read more]

Set Devexpress LookupEdit Datasource use msSQL Stored Procedure

Posted On // Leave a Comment
Sub __OpenRsTipe()
        Dim dtTipe As New DataTable
        With _SqlCommand
            .CommandText = "mstTipe_SELECT_id_Nama_WHERE_Merek_Honda"
            .Parameters.Clear()
            _SQLReader = .ExecuteReader
        End With
        dtTipe.Load(_SQLReader)
        With LookUpTipe
            .Properties.DataSource = dtTipe
            .Properties.ValueMember = "Nama"
            .Properties.DisplayMember = "Nama"
            .Properties.PopupWidth = 250
        End With
        _SQLReader.Close()
    End Sub
[Read more]

Get RepositoryItemLookUpEdit Row Value

Posted On // Leave a Comment
With RepositoryItemLookUpEditSearch
     MsgBox(.GetDataSourceValue("ID", .GetDataSourceRowIndex("Nama", _
     txtSearch.EditValue)).ToString)
End With

[Read more]

DevExpress set LookUpEdit Repository

Posted On // Leave a Comment
Berikut adalah syntax yang digunakan pada component DevExpress data Repository LookUpEdit

Dim dsNomorRangka As New DataSet
Dim daNomorRangka As SqlDataAdapter = New SqlDataAdapter("crmFollowUpSalesDelivery_lstNomorRangka", SQLConnection)

With daNomorRangka
.SelectCommand.CommandType = CommandType.StoredProcedure
      .SelectCommand.Parameters.Clear()
      .SelectCommand.Parameters.Add("@CabangID", SqlDbType.NVarChar, 2).Value = "21"
      .SelectCommand.Parameters.Add("@NomorRangka", SqlDbType.NVarChar, 20).Value = "MHRGD" ' cboNomorRangka.EditValue
End With

daNomorRangka.Fill(dsNomorRangka)

With RepositoryLookupNomorRangka
.DataSource = dsNomorRangka.Tables(0)
      .ValueMember = "NomorRangka"
      .DisplayMember = "NomorRangka"
End With
[Read more]