Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
330
Default value to Ultracombo in Ultragrid
posted

Hello,

I have an ultracombo in the ultragrid. I would like to set the default value to "N/A" to the ultracombo from the dataset. Please help me out and below is the code and I don't know where im making a mistake.

Private Sub BindJurisdictionDropDown()
      JurisDT = GetJuris.Tables(0)-------{"AB","BC","CD","N/A"}
      ucb_Juri.SetDataBinding(JurisDT , Nothing)
      ucb_Juri.ValueMember = "JurisID"
      ucb_Juri.DisplayMember = "Juris"
End Sub

Private Sub UG_InitializeLayout(sender As Object, e As UltraWinGrid.InitializeLayoutEventArgs) Handles UG.InitializeLayout

Try

With e.Layout.Bands(0)
    .Columns("JID").TabStop = True

   .Columns("JID").ValueList = ucb_Juri

    .Columns("JID").MinWidth = 25
    .Columns("JID").Style = ColumnStyle.DropDownList

  For Each row As UltraGridRow In ucb_Juri.Rows()

     If row.Cells("JID").Text = "N/A" Then

              ucb_Juri.SelectedRow = row
     End If
  Next

End With

Catch

end Sub

Thanks,

AB