Solved

Adding WebGrid Checkbox Column checked by default

Posted on 2016-10-18
3
66 Views
Last Modified: 2016-10-18
I have added a checkbox column to my grid and seems to work. But how can I have the all checkbox checked by default?
@DGrid.GetHtml(columns: DGrid.Columns(
        DGrid.Column(header: "Update?", format: @<text><input name="chkbox"
                                                                  type="checkbox" value="SLID" /></text>),
        DGrid.Column("Item"),
        DGrid.Column("Serial"),
        DGrid.Column("Asset")
            )

Open in new window


Using VS 2015 MVC
0
Comment
Question by:KDog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
ID: 41848884
Does this work?

@DGrid.GetHtml(columns: DGrid.Columns(
        DGrid.Column(header: "Update?", format: @<text><input name="chkbox"
                                                                  type="checkbox" value="SLID" checked /></text>),
        DGrid.Column("Item"),
        DGrid.Column("Serial"),
        DGrid.Column("Asset")
            )

Open in new window

0
 

Author Closing Comment

by:KDog
ID: 41848922
Yes that worked. Thank you. Can't believe it was that simple. I feel like I've wasted time.
0
 
LVL 20

Expert Comment

by:Daniel Van Der Werken
ID: 41848930
Glad to help!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question