Advertisement

05.11.2008 at 11:12PM PDT, ID: 23393748
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

How to filter 2nd combo box based on the value of 1st combo box in a DataGridView in VB.net 2005?

Tags: DataGridView Default Error Dialog:
* I am trying to display Order Details of a related orders of a customer in a 2nd DataGridView in my form from a disconnected dataset. This grid is to be used for updating existing orders and adding new orders. Displaying and updating is working fine.. no problem.
* In my DGV along with other cols, I am displaying 3 cols as 3 dependent combo box for Main Item, Sub Item and Detail Items. Sub Item combox will ONLY display the related sub items of the Main Item selected in the previous Main item Combo Box. Similar for Detail Items. I am using 3 separate unfiltered dataset for my 3 codetables. I want to filter my next combo box only when previous combo box is clicked or changed.
* This feature I have easily in my VB6 application long before. I have tried to filter the datasource whenever the MainItem combox is clicked or value change using DGV_CellBeginEdit and DGV_CellEndEdit procedures. Also tried DGV_CellLeave procedures. When I move/click 1st combo box it works fine showing all the expected value, but whenever I move to next combo box which is to be filtered I got this annoying error message. Through debugging it seems that filtering is working BUT could not display the expected result in the 2nd combo box.

* PLEASE HELP ME RESOLVEING THIS PROBLEM. I CAN'T MOVE FORWARD UNLESS IT IS SOLVED.

Ibrahim
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
====================================================================
Snippet of Form_Load:
====================================================================
 Me.ta_LkUp_ItemMainCategory.Fill(Me.ds_LkUp_ItemMainCategory.ct_ItemMainCategory)
 
'TODO: This line of code loads data into the 'ds_LkUp_ItemMainCategory.ct_ItemMainCategory' table. You can move, or remove it, as needed.
 
===================================================================
Snippet of CellBeginEdit:
===================================================================
    Private Sub dgv_OrderDetail_CellBeginEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellCancelEventArgs) Handles dgv_OrderDetail.CellBeginEdit
        '--------------------------------------------------------------------------------------------->
        Try
            If dgv_OrderDetail.Columns(e.ColumnIndex).Name = "dgvCbx_ItemMainCategory" Then
                Dim sSQL As String = dgv_OrderDetail.Item("dgvCbx_ItemMainCategory", e.RowIndex).Value.ToString
                Dim sSq As String = "'"
 
                dgvCbx_ItemSubCategory.DataSource = bs_LkUp_ItemSubCategory
                bs_LkUp_ItemSubCategory.Filter = "ITMC_IDA = " & sSq & sSQL & sSq
 
            End If
 
        Catch ex As Exception
            MessageBox.Show(ex.Message)
 
        End Try
        '--------------------------------------------------------------------------------------------->
 
    End Sub
====================================================================
Snippet of CellEndEdit:
====================================================================
    Private Sub dgv_OrderDetail_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv_OrderDetail.CellEndEdit
        Try
            dgvCbx_ItemSubCategory.DataSource = bs_LkUp_ItemSubCategory
            bs_LkUp_ItemSubCategory.RemoveFilter()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
 
        End Try
    End Sub
Attachments:
null
DATAGRIDVIEW ErrorMessage
DATAGRIDVIEW ErrorMessage
 
null
Sample datagrid view of OrderDetails
Sample datagrid view of OrderDetails
 
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: MMIbrahim
Solution Provided By: MMIbrahim
Participating Experts: 1
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
05.12.2008 at 02:43AM PDT, ID: 21545546

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 03:24AM PDT, ID: 21545679

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 04:41AM PDT, ID: 21545990

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.13.2008 at 12:11AM PDT, ID: 21552850

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.19.2008 at 11:34PM PDT, ID: 21603914

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628