Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
Creating a button.
posted

I created an unbound column and I want the cells in that column to be an button with an icon in it,  Below is the code that I have but I can't seem to get the icon to appear.  This is all being accomplished in the InitializeLayout.

 What am I missing?

// Add a new column...

UltraGridColumn editButton = e.Layout.Bands[0].Columns.Add(EDIT_USER, "Edit User");

editButton.CellButtonAppearance.Image = "~/Resources/Plus.ico";

// Make this column a button...

e.Layout.Bands[0].Columns[EDIT_USER].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;

e.Layout.Bands[0].Columns[EDIT_USER].ButtonDisplayStyle = ButtonDisplayStyle.OnCellActivate;

e.Layout.Bands[0].Columns[EDIT_USER].CellButtonAppearance.Image = "~/Resources/Plus.ico";

Parents
No Data
Reply
  • 469350
    Offline posted

    It looks like you are setting the Image property to a string. It does not take a string, it takes either an Image (like a Bitmap) or an index into the grid's ImageList (if one is assigned).

    By passing in a string, the grid is probably assuming you are referring to the Key of an image in the grid's ImageList and you probably have not assigned an ImageList. 

     

Children