protected override Rectangle CalcTextBounds(FilterPanelInfoArgsBase e, Rectangle client) { CustomGridControlViewInfo viewInfo = (e as CustomGridFilterPanelInfoArgs).viewInfo; Rectangle textBounds = base.CalcTextBounds(e, client); int customizeButtonWidth = 0, activeButtonWidth = 0; if (e.ShowCustomizeButton) { customizeButtonWidth = viewInfo.GetButtonWidth(e.CustomizeButtonInfo.Bounds); } if (e.ShowActiveButton) { activeButtonWidth = viewInfo.GetButtonWidth(e.ActiveButtonInfo.Bounds); } int textWidth = 0; if (e.DisplayText != string.Empty) { int leftBorder = textBounds.X + textBounds.Width + viewInfo.GetButtonsWidth(viewInfo.LeftButtons); int rightBorder = e.Bounds.Width - (viewInfo.GetButtonsWidth(viewInfo.RightButtons) + customizeButtonWidth + activeButtonWidth); if (leftBorder > rightBorder) { textWidth = e.Bounds.Width - textBounds.X - viewInfo.GetButtonsWidth(viewInfo.LeftButtons) - viewInfo.GetButtonsWidth(viewInfo.RightButtons) - customizeButtonWidth - activeButtonWidth; if (e.AllowMRU) { textWidth -= e.MRUButtonInfo.Bounds.Width + viewInfo.Offset; } return(new Rectangle(textBounds.Location, new Size(textWidth, textBounds.Height))); } } return(textBounds); }
protected override void DrawFilterPanel(ViewDrawArgs e) { if (viewInfo == null) { viewInfo = (e.ViewInfo as CustomGridControlViewInfo); } viewInfo.CheckMRUButton(); if (!viewInfo.DrawMRU) { viewInfo.FilterPanel.MRUButtonInfo.Bounds = new Rectangle(); } base.DrawFilterPanel(e); viewInfo.CalcButtons(); DrawButtons(e.Cache, viewInfo.RightButtons); DrawButtons(e.Cache, viewInfo.LeftButtons); }
public CustomGridFilterPanelInfoArgs(CustomGridControlViewInfo info) : base() { viewInfo = info; }
protected override void CreateMainView() { base.CreateMainView(); gridControlView = (Views.FirstOrDefault() as CustomGridControlView); gridControlViewInfo = Views.FirstOrDefault().GetViewInfo() as CustomGridControlViewInfo; }