none
How can I add a button or link to the left column of a grid? RRS feed

  • Question

  • Hi all

    I want to put a link on a Data Grid that opens another screen.

    I've followed Beth Massi's excellent article here:

    http://blogs.msdn.com/b/bethmassi/archive/2011/10/06/i-command-you-lightswitch-screen-commands-tips-amp-tricks.aspx

    See the second image down with the Delete buttons on the grid.  That is a button added to the Data Row Command bar which, on the designer is just above the first data column.

    Is there a way that I can move the buttons (in my case links) to a column on the left?

    The closest I can get is to pull the Command Bar down so it's below the first column, in this case it would be below Last Name. But... that means it's physically below last name so every row is then double height.

    There doesn't appear to be a way to simply move it to the left.

    Thanks

     




    • Edited by icosa Thursday, January 26, 2012 7:54 PM
    Thursday, January 26, 2012 7:51 PM

Answers

All replies

  • hi!

    im not sure if it can be done in screen designer (or in code), but in runtime you can drag that command column all-way to the left, settings will be stored (locally) next time you open application.. but im also curious can it be done..

    Kivito


    Nobody expects the Spanish Inquisition! (M.P.F.C.)
    Thursday, January 26, 2012 8:00 PM
  • Thanks Kivito

    In my development environment in Visual Studio it doesn't seem to remember the settings next time if I drag the column but I'll try that when I deploy again.

    Thursday, January 26, 2012 8:03 PM
  • is your app a web app? cause i think if you use desktop app, it should store settings in my documents folder..

    Kivito


    Nobody expects the Spanish Inquisition! (M.P.F.C.)
    Thursday, January 26, 2012 8:09 PM
  • It's on a trial account at Azure.

    I just tried an earlier version that is deployed and that does save the grid settings so... I guess that will have to do for now.  I would be nice to be able to set it by default.

     

    Thursday, January 26, 2012 8:14 PM
  • Is this what you're trying to do?


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    If you find a reply helpful, please click "Vote as Helpful", if a reply answers your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.
    • Marked as answer by icosa Friday, January 27, 2012 4:38 PM
    Friday, January 27, 2012 12:45 AM
    Moderator
  • Yes, thanks.  Adding a group was the answer.
    Friday, January 27, 2012 4:39 PM
  • heh, so simple.. thanks Yann!

    Kivito


    Nobody expects the Spanish Inquisition! (M.P.F.C.)
    Friday, January 27, 2012 4:44 PM
  • You're both very welcome!

    If I remember correctly I got this technique from Garth, so you should thank him too. I remember the technique mostly becuase I don't like it, lol.

    I'd prefer to use ONE grid button, than use a button in *each* grid row.

    But, it's best to use whatever suits what you need in your application.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    If you find a reply helpful, please click "Vote as Helpful", if a reply answers your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.
    Saturday, January 28, 2012 12:43 AM
    Moderator
  •  

    Hi Mr. Duran.

    I just want to ask,What  if I want the Test Method button be created as AddNewData button, How to put code on that button, so that when I click  it, it will open an Add New Data Screen but it will automatically filled-in the Casual Name and Full Name Column with the data of that selected row  while the rest of the column is blank so that what I will only type in is the data on the blank column and save it as new data.



    • Edited by Kentrox Tuesday, January 31, 2012 7:09 AM
    Tuesday, January 31, 2012 1:51 AM
  • Thank a lot! Been looking for months for this.

    This should be the default behavior when adding command buttons if you'll ask me...


    rdk

    Sunday, August 26, 2012 9:37 AM
  • I just tried this, in the RTM version of LS 2012, and when I add the additional group to the grid, there's no command bar! Any ideas???
    Saturday, October 6, 2012 1:56 PM
  • The command bar for a grid control will be in the grid contro itselfl, not in the group control. Having said that though, you can right-click just about any control & "add a button". If that control's command bar wasn't visible before, it will be visible after the add the button.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    If you find a reply helpful, please click "Vote as Helpful", if a reply answers your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.

    Monday, October 8, 2012 1:34 AM
    Moderator