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.
Syncfusion Feedback

Determining Drop Down Grid selections

Thread ID:

Created:

Updated:

Platform:

Replies:

6455 Aug 13,2003 11:27 AM UTC Aug 14,2003 11:32 AM UTC Windows Forms 3
loading
Tags: GridControl
David Gonzales
Asked On August 13, 2003 11:27 AM UTC

hi, I am trying to setup a grid with several dropdown grid and then determine in the CurrentCellDropDown event which drop down grid was selected and then determine the selections made by the user (they have a checkbox in the first column for the user to select which one(s) they want). I can determine the selections once I know the grid that was dropped down but I can't seem to figure out which dropdown is currently enabled. I have used the DropDownGrid sample as my guide. My code looks some like this so far: Dim GridA as GridControl Dim GridB as GridControl Dim GridC as GridControl etc, etc. 'setup each drop grid GridA = New GridControl() GridA.Cols.Hidden.Item(0) = True GridA.ThemesEnabled = True GridA.CausesValidation = False 'routine to populate the grid with coded information FillDropGrid(GridA, "HeadCodes") Dim aModel as New DropDownGridCellModel(Me.GridControl3.Model) aModel.EmbeddedGrid = GridA GridControl3.CellModels.Add("GridADropCell",aModel) 'similar routines for all the rest of the grids 'finally add the grid to a cell GridControl3(2,1).Text = "Task" GridControl3(2,1).CellType = "GridADropCell" GridControl3(3,1).Text = "Formulation" GridControl3(3,1).CellType = "GridBDropCell" etc, etc. So what I am after is when the user clicks the drop arrow (to close the drop grid) I would like to be able to get the grid that was associated with and then get my selections (in the CurrentCellDropDown event). I am close but am missing one or two key points to getting this totally done. Thank you all very much. David A. Gonzales

Administrator [Syncfusion]
Replied On August 13, 2003 12:29 PM UTC

In the CurrentCellShowingDropDown (or CurrentCellShowedDropDown), you can get the current cell of the parent grid, and from it, get the row and column of the parent grid. Once you have the row and column, is that enough for you to know the dropped grid that is being used? 'In CurrentCellShowingDroDown Dim cc as GridCurrentCell = Me.parentGrid.CurrentCell 'now cc.RowIndex and cc.ColIndex have teh row and column

David Gonzales
Replied On August 13, 2003 03:25 PM UTC

Clay, Boy that was easy! I guess I try and make things harder than they are. Thanks for the info! David

David Gonzales
Replied On August 14, 2003 11:32 AM UTC

Clay, After the help you gave me I came up with an easy way to determine which sub-grid the user has selected. While many people already now how to do this I am posting it for all the newbie's (like myself) out there. Private Sub GridControl3_CurrentCellCloseDropDown(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.PopupClosedEventArgs) Handles GridControl3.CurrentCellCloseDropDown Dim cc As GridCurrentCell = GridControl3.CurrentCell Dim myGrid As GridControl Dim strTmp As String Dim nRow = cc.Renderer.CurrentCell.RowIndex Dim nCol = cc.Renderer.CurrentCell.ColIndex Dim mySubGrid As GridControl Dim myDropDownModel As DropDownGridCellModel myDropDownModel = GridControl3.CellModels(GridControl3(nRow, nCol).CellType.ToString()) mySubGrid = myDropDownModel.EmbeddedGrid strTmp = "" If Not (mySubGrid Is Nothing) Then strTmp = GetGridItems(mySubGrid) End If End Sub At the end of the call the list of items selected is in the strTmp string (which I use later). Hope this helps others out there. David.

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.

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

;