Default Add/Edit buttons RRS feed

  • Question

  • Can I change the display text for the default <plus sign> and <pencil icon> for the data grid Add and Edit buttons to display "Add" or "Edit" instead?

    Not tooltips, I want to change the default icons displayed to text like a custom button. 

    I tried creating a new button and pointing it to the default methods LightSwitch creates, but that just resulted in another <plus sign> and <pencil icon>.

    Thanks in advance.

    Thursday, September 5, 2013 1:59 PM


  • Hi Mark,

    I could not think of a way you can do so without writing custom code, but here's a work-around with custom code: Let's say I want to have an Add Edit New button that will display as a text button 'Add'.

    Add a new button bound to a custom method named 'MyAddEditNew' to the Grid Command Bar. Change the display name to 'Add'. (Delete the built in buttons).

    Write the following code for the CanExecute and Execute method.

            partial void MyAddEditNew_CanExecute(ref bool result)
                result = this.Customers.CanAddNew;
            partial void MyAddEditNew_Execute()
    Replace Customers with the name of the Visual Collection the grid is bound to. (The built-in buttons call the same property and method beneath the cover).

    Best regards,

    Friday, September 6, 2013 8:08 PM