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
close icon

My grid Cells doesn''t Refresh

hi;
i used a grid control in my application.it has 2 combo box columns.i also have a listbox which has diffrent values.with selecting diffrent items in listbox the combo column should be refresh with new bound values (from a query based on listbox value).but the combo column doesn't refresh with changing listbox values.i was wondering if it is possible to find the best way for refreshing the bound combo box column .Thanks.


3 Replies

NA Nisha Arockiya A Syncfusion Team October 21, 2008 07:19 AM UTC

Hi Shayesteh,

Thanks for your interest in Syncfusion Products.

You can acheive this by refreshing that row after the selection has been done by handling the CurrentCellCloseDropDown event.



private void gridDataBoundGrid1_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
GridDataBoundGrid grid = (GridDataBoundGrid)sender;
GridCurrentCell currentCell = grid.CurrentCell;

if(grid.Binder.NameToColIndex("Col1") == currentCell.ColIndex)
{
currentCell.ConfirmChanges();
grid.RefreshRange(GridRangeInfo.Row(currentCell.RowIndex));
}
}


Please let me know if this helps.

Regards,
Nisha




SB solmaz Bahramian October 21, 2008 10:21 AM UTC

thanks but it doen't work for me.because if i want my combo box column Refresh correctly,i should Click on another column first ,then click on my combo box column again.in this case it will refresh.so how can i refresh my combo box values whithout clicking on another columns of grid .i want refresh my combo box column in MyListView_SelectedIndexChanged() event.i mean when i change diffrent items in listbox ,The combo box column refresh.Thanks.



NA Nisha Arockiya A Syncfusion Team October 22, 2008 01:11 PM UTC

Hi shayesteh,

This can be achieved by using the CurrentCellShowingDropDown 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,
Nisha


Loader.
Live Chat Icon For mobile
Up arrow icon