Hi Arulpriya Ramalingam,
First i want say thank you for your helping.
In my case i do not trying to edit the content of RichText cell instead of editing through the DropDown container or hide/disable the DownDown button.
I am trying to editing DropDown Container. Example : disable button , or disable chose font, font size
Thank you,
Best Regards
|
gridGroupingControl1.TableControlCurrentCellShowingDropDown += GridGroupingControl1_TableControlCurrentCellShowingDropDown;
private void GridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
var ren = e.TableControl.CurrentCell.Renderer as GridRichTextBoxCellRenderer;
var panel = ren.DropDownContainer.Controls[0] as GridRichTextEntryPanel;
for (int i = panel.Controls.Count-1; i >= 0; i--)
{
if (!(panel.Controls[i] is RichTextBox))
panel.Controls.Remove(panel.Controls[i]);
}
//To remove the unwanted spaces
panel.Controls[0].Dock = DockStyle.Fill;
}
private void GridGroupingControl1_TableControlCurrentCellCloseDropDown(object sender, GridTableControlPopupClosedEventArgs e)
{
var ren = e.TableControl.CurrentCell.Renderer as GridRichTextBoxCellRenderer;
var panel = ren.DropDownContainer.Controls[0] as GridRichTextEntryPanel;
var s = panel.Controls[0].Text;
int rowIndex = e.TableControl.CurrentCell.RowIndex;
int colIndex = e.TableControl.CurrentCell.ColIndex;
GridTableCellStyleInfo sty = e.TableControl.GetTableViewStyleInfo(rowIndex, colIndex);
Record rec = sty.TableCellIdentity.DisplayElement.GetRecord();
if (rec != null)
rec.SetValue(sty.TableCellIdentity.Column.Name, s);
} |