this time in this code i dont know how to make this problem worked pleae help sir, thanks god bless 'column2 'connect combobox to excel to get items per range Dim xlApp = New Excel.Application With ' path of Excel file Dim xlBook = ("C:\Documents and Settings\itdsba\My Documents\Visual Studio 2010\ucpb5s\data5s.xls") Dim xlSheet = DirectCast(xlBook.Worksheets(3), Excel.Worksheet) Dim LastLine As Long LastLine = xlSheet.Range("A65536").End().Row 'range in excel sheet ' Dim a As Range = xlSheet.Range("A2:A9") Dim column2 As New DataGridViewComboBoxColumn column2.Name = "Details" column2.HeaderText = "DetailsofDemerits" Dim a As Range = xlSheet.Range("A2:A" & LastLine) For Each rng As Range In a 'add the data from Excel to combobox column () Next 'For Each rng As Range In a ' 'add the data from Excel to combobox column ' () 'Next xlBook.Close(SaveChanges:=True) xlApp.Quit() xlApp = Nothing GC.Collect() GC.WaitForFullGCComplete() column2.Width = 200 (column2) = DataGridViewContentAlignment.MiddleCenter column2.DisplayStyle = DataGridViewComboBoxDisplayStyle.NothingĪnd lastly this code for passing the items from checkedlistbox to datagridview. Sir, below is getting the data or items to my combobox
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |