This will solve BIG RED X promblem as well. Then when you create the columns, you have to create them as the new class you created and then add them to the TableStyle.įor reference see following. SOLUTION 2 : The better solution is to create a new class that inherits the DataGridTextBoxColumn. ( PROBLEM ) The problem with this solution is, horizontal and verticle scrollbars will become disable. SOLUTION 1 : Just disable the grid before assigning datasource and enable it right after assigning the datasource. The above line will cause following error ( not consistent )ĮRROR : Column 'ColumnName' does not belong to table 'Table'.Įven if you try to execute following line into immediate window this will give proper value. GrdResults.DataSource = dataset.Tables(0).DefaultView or dataset.Tables(0) Try assigning datasource for grdResutls like following Following is the solution.ĭ = true // Index zero is the horizontal scrollbarĭ = true // Index one is the vertical scrollbar Sometimes after assignment of a dataset to datagrid, verticle and horizontal scroll bars donot get enabled even if the grid is enabled or even if there are enough records to scroll. Your comments and suggestions are highly apprecited. So for that i will first describe the prblem and then i will explain how i solved it. I decided to share my experience with you guys. Net framework 1.1,i found solutions for few of them, and still trying to cope rest of the problems. MessageBox.Show("Student name = " & obj.Name & " Course Assigned = " & obj.Course)ĭatagrid seems to be one of the most difficult controls i have ever experienced as far as software development for microsoft platform is concerned, i faced several problems while working with datagrid specially on. Private Sub student_courseAssigned(ByVal obj As student) Handles urseAssigned Student.Course = "Artificial Intellegence" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Public Event oncourseAssigned(ByVal obj As Student) This code snippet contains one class named Student, which has two attributes name and course, exposed a public event as oncourseAssigned, and whenver a new course is assigned it raises an event named onCourseAssiged. For now, if you need to learn how to implement custom events in vb.net 2003/2005 see following code snippet, i will explain this later on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |