Solved

Adding WebGrid Checkbox Column checked by default

Posted on 2016-10-18
3
26 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
  • 2
3 Comments
 
LVL 19

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 19

Expert Comment

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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now