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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Bound Datagrid with filtered DataView

Thread ID:





2259 Dec 24,2002 04:30 PM UTC Dec 24,2002 05:20 PM UTC WinForms 1
Tags: GridControl
Charles Carlin
Asked On December 24, 2002 04:30 PM UTC

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 05:20 PM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon