I have added a column in ultrawingrid and set the style to ColumnStyle.EditButton.In the cell am displaying data from the database.as the data is too long to display in the cell, when the user clicks on the edit button of the cell,i need to display in a popup kind of control(may be multi line textbox).
Please suggest me how can i implement this functionality.
Hi,
Oh, I see.
The only way to make the button height smaller than the row height would be to use a CreationFilter.As CreationFilters go, this would be a pretty simple one. You just have to change the Rect of the EditButtonUIElement.
Here's a sample CreationFilter that makes the button a square and centers it vertically within the cell.
public class MyCreationFilter : IUIElementCreationFilter { #region IUIElementCreationFilter Members void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { // Watch for a CellUIElement if (parent is CellUIElement) { //See if there is an EditButton inside the cell. UIElement editButtonUIElement = parent.GetDescendant(typeof(EditButtonUIElement)); if (editButtonUIElement != null) { // Use the buttons width as it's height so it's a square. int buttonHeight = editButtonUIElement.Rect.Width; // Center the button within the cell. Rectangle cellRect = parent.Rect; int buttonTop = cellRect.Top + ((cellRect.Height - buttonHeight) / 2); editButtonUIElement.Rect = new Rectangle( editButtonUIElement.Rect.X, buttonTop, editButtonUIElement.Rect.Width, buttonHeight ); } } } bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { // Do nothing return false; } #endregion }
ya i understand that. but is there anyway to change the button height to smaller than the row content. bcoz i have row content really big 5-10 lines and big button not looks good.
I am having a hard time understanding your question.
The height of the button is determined by the height of the cell. So the only way to control the button height is to adjust the row height.
The width of the button is determined by it's contents. So you can set the Text or apply an image to the button and it will resize itself (and possibly the row height) to fit.
hi
i have ultragrid column with style EditorButton and want to resize the button in the cell. My cell is having large value so height of button is same as cell value but i dn't wan button with big hight. can it be possible to change height of the button?
siddika said:when i am setting cell value on ultrsTextEditor1_AfterEditButtonCloseUp event , it set null value even though ultraTextEditor2 contains Text.
The Value property of the cell reads from the underlying DataSource. So if you type text into a cell, the Value property will not reflect that text until the cell is committed to the data source - usually when you leave the cell. While the cell is in edit mode, you have to use the Text property of the cell.