?
Solved

Adding WebGrid Checkbox Column checked by default

Posted on 2016-10-18
3
Medium Priority
?
93 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

765 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