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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

changing the DataTable of a combobox in GridDataBoundGrid

Thread ID:





42962 Apr 11,2006 09:12 AM UTC Apr 11,2006 10:22 AM UTC WinForms 1
Tags: GridControl
Fady Sayegh
Asked On April 11, 2006 09:12 AM UTC

Hi to all, i''m using the GridDataBoundGrid control. i have a column that contains a combobox of countries and another one that contains the cities. when i choose in the first the country i want to refresh the second with the cities of that country. i made this line of code : DataSet oDsUSACities = new DataSet(); GridDataBoundGrid oGridDataBoundGrid = ((GridDataBoundGrid) sender); if (oGridDataBoundGrid.CurrentCell.ColIndex == 2) { if (gridDataBoundGrid2[oGridDataBoundGrid.CurrentCell.RowIndex, oGridDataBoundGrid.CurrentCell.ColIndex].CellType == "ComboBox") { if (int.Parse(gridDataBoundGrid2[oGridDataBoundGrid.CurrentCell.RowIndex, oGridDataBoundGrid.CurrentCell.ColIndex].CellValue.ToString()) == 1) FillDatasetCitiesOfUSA(ref oDsUSACities); } // gridDataBoundGrid2[oGridDataBoundGrid.CurrentCell.RowIndex, oGridDataBoundGrid.CurrentCell.ColIndex + 1].DataSource = oDsSyndicats2.Tables["TABLE_CITIES2"]; gridDataBoundGrid2.GridBoundColumns[2].StyleInfo.DataSource = oDsSyndicats2.Tables["TABLE_CITIES2"]; } my datagrid must look like this : First combo Second combo 1 USA Washington New york Miami 2 England London Liverpool Manchester 3 France Paris Marseille Lyon best regards and thanks in advance fady

Administrator [Syncfusion]
Replied On April 11, 2006 10:22 AM UTC

Hi Fady, This can be achieved by using the CurrentCellCloseDropDown event. In the event, the datasource / cellvalue of the second column can be changed depending on the value selected in the first combobox column. Refer to this forum thread for more details : Forum_42073 KB article : How do I change the DataSource of one ComboBox cell depending upon the value selected in another ComboBox cell in a GridDataBoundGrid? Best regards, Madhan


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

or the page will be automatically redirected to 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