We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Bound Datagrid with filtered DataView

Thread ID:

Created:

Updated:

Platform:

Replies:

2259 Dec 24,2002 11:30 AM Dec 24,2002 12:20 PM Windows Forms 1
loading
Tags: GridControl
Charles Carlin
Asked On December 24, 2002 11:30 AM

I have a DataBoundGrid control that is bound to a DataView. The dataview is using a filter to only show rows that match on a certain foreign key. I was to allow the user to add new rows to the grid and automatically populate that column with the value that is being used to filter the view. I have tried placing the code to set the value in a number of different events but have not had any luck. This is a hidden column as they user has no need to know anything about it. What is the best way of going about this? Which event should I be using.

Administrator [Syncfusion]
Replied On December 24, 2002 12:20 PM

Do you want to do this work when the user types in the new row at the bottom of the grid? If so, you can try catching the RowEditing event and test to see if you are on that last row.
    Private Sub GridDataBoundGrid1_RowEditing(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridRowEventArgs) Handles GridDataBoundGrid1.RowEditing
        Dim cm As CurrencyManager
        cm = CType(Me.BindingContext(Me.GridDataBoundGrid1.DataSource, Me.GridDataBoundGrid1.DataMember), CurrencyManager)
        Dim editRowIndex = Me.GridDataBoundGrid1.CurrentCell.RowIndex
        If (editRowIndex > cm.Count) Then
            Console.WriteLine("new row GridDataBoundGrid1_RowEditing")
        End If
    End Sub

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;