none
Windows form VB.net tab control

    Question

  • In a VB.net Windows form, it has a tab control with several tab pages. One of the tab page it has a groupbox with several radio buttons in it. The tag of the groupbox is binded to a dataset field. On the tab control "Selecting" event  to select that tab page, it refreshes the binding dataset and after to check the radio button using the tag value binded to the groupbox. It never works in terms of checking off the radio button the very first time when selecting that tab page and it will work in checking off the radio button after. Don't understand why and how this happens?
    Thursday, November 04, 2010 10:51 PM

All replies

  •  

    -> The tag of the groupbox is binded to a dataset field. On the tab control "Selecting" event  to select that tab page, it refreshes the binding dataset and after to check the radio button using the tag value binded to the groupbox.

     

    How do you use the “selecting” event to refreshes the binding dataset?

    Could you please give me an example?

    Best regards,

    Ling Wang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, November 10, 2010 9:22 AM
  • Hi,

     

    How is this issue now?

     

    If your problem still can’t be solved, could you please provide more details or make a demo project for us to test?

     

    Best regards,

    Ling Wang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, November 11, 2010 8:08 AM
  • Instead of checking the tag value to the groupbox to check off/on the radiobutton. I have to use the "GetData" method in the tableadapter to get the value of the column (assuming that always a single row is returned) and then write a "select case" statement to chcek off/on the radiobutton inside the groupbox.

    So on the tab control "selecting" event if the tab page is selected and it will run a sub routine to check the value of teh column as follow:

    Here is one of the example

        Dim str_teeth_restore As String
        Dim baseline_survey_id As Integer
        baseline_survey_id = Me.dgv_baseline_survey_list.CurrentRow.Cells("dgv_baseline_survey_list_txt_baseline_survey_id").Value
        str_teeth_restore = Me.ta_mucositis_sialometry_one.GetData(baseline_survey_id).Item(0).teeth_restore.ToString
        Select Case str_teeth_restore
          Case "Y"
            Me.sa_rb_teeth_restore_yes.Checked = True
    
          Case "N"
            Me.sa_rb_teeth_restore_no.Checked = True
    
          Case "U"
            Me.sa_rb_teeth_restore_unknown.Checked = True
    
          Case Else
            Me.sa_rb_teeth_restore_yes.Checked = False
            Me.sa_rb_teeth_restore_no.Checked = False
            Me.sa_rb_teeth_restore_unknown.Checked = False
    
        End Select
    
    Monday, November 15, 2010 11:39 PM