GDBD, CellTipText and SelectedIndex

I have a GridDataBoundGrid that last column of this grid has cell type comboBox. I want to have tooltip (use CellTipText) for this column. The text for ToolTip is not static. That means depends to selectedIndex of comboBox it contains different text. As you know it is hard to get SelectedIndex for comboBox in GDBG. As far as I know I can only have that in three events CurrentCellCloseDropDown, CurrentCellShowingDropDown and CurrentCellShowedDropDown. I used CurrentCellCloseDropDown as follow. But the problem is I can''t set CellTipText in CurrentCellCloseDropDown event because it is GDBD. I have to do it in QueryCellInfo event for example but in QueryCellInfo I don''t have the SelectedIndex for comboBox. What can I do to achieve this goal? Thanks. I am using Syncfusion 3.3. private void gridTimer_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e) { GridDataBoundGrid grid = sender as GridDataBoundGrid; int index; if(grid != null) { GridCurrentCell cc = grid.CurrentCell; GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer; if(cc != null) { index = cr.ListBoxPart.SelectedIndex; //Set the new Tooltip text Guid _id = _Test.LogicInputs[index].Id; // selected item in combobox LogicInputDetails liDetails = GetLogicInputDetails(_id); this.gridTimer[cc.RowIndex, cc.ColIndex].CellTipText = liDetails.LogicInputString; } } }

2 Replies

ST stanleyj Syncfusion Team December 21, 2005 03:04 PM UTC

Hi Najmeh, To set style for a GridDataBoundGrid PrepareViewStyleInfo or Model.QueryCellInfo handler is to be used. So to have a non static CellTipText, a hashtable is used in this sample to store the selected index and then the values in the hashtable are assigned to the grid cells through PrepareViewStyleInfo handler. Best regards, Stanley


NJ Najmeh Joze-khajavi December 21, 2005 07:15 PM UTC

Thanks. It does the work.

Loader.
Up arrow icon