Solved

Which way to use

Posted on 2014-02-27
9
162 Views
Last Modified: 2014-03-06
Hi,
Is it fine that we have a checkbox for the repeater list, thus we can do a "tick" for the relevant records? Or better we should use Gridview/listview for doing this?
0
Comment
Question by:HuaMinChen
[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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 7

Expert Comment

by:peea
ID: 39893835
If a simple control can do that, what's point to use a complex control using more space, resource, code and even database access?

KISS - Keep it simple, stupid. :-)
0
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 35 total points
ID: 39893885
you can use repeater list , no issues

also please find the attached image to undertans ahat all functionalities all this contorls support
will help you to select correct one
pr.jpg
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 39893895
Which is better for this, among repeater, Gridview, Listview and etc?
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 7

Accepted Solution

by:
peea earned 35 total points
ID: 39893899
Repeater.

Any concerns for you to choose the others?
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 39893906
Listview

As it is providing other functionalities also
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 39894111
Thanks all.
Peea,
I think it is a problem to have a checkbox within a repeater list as it is only a list of text items. If it is really fine to use a repeater, can you demonstrate it?
0
 
LVL 7

Expert Comment

by:peea
ID: 39896500
FYI - not sure if you ever read this discussion.
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 39896807
Hi,
Thanks. I think there is no way to use Repeater for this case right? If I assign a recordset to a repeater, how about the existing Checkbox within the repeater? Will there be no problem with it?
0
 
LVL 53

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 35 total points
ID: 39897047
I am not a .NET dev but reading into that answer, it is calling for the rendered html to display the checkbox in a repeater and later to be collected to a hidden field you can capture.  I have created the front end sample using a text box instead of hidden for demonstration.
http://jsbin.com/padasQ_28376831/1/
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
  <script>
    $(function () {
    // listen for check/uncheck
    $('input.use_bold').change(function () {
        var collected_data_bold = [];
        $('input.use_bold').each(function () {
            if ($(this).is(':checked')) {
                collected_data_bold.push($(this).val());
            }
        });
        $('[name="collected_data_bold"]').val(collected_data_bold);
    });
    // listen for check/uncheck
    $('input.use_red').change(function () {
        var collected_data_red = [];
        $('input.use_red').each(function () {
            if ($(this).is(':checked')) {
                collected_data_red.push($(this).val());
            }
        });
        $('[name="collected_data_red"]').val(collected_data_red);
    });

});
    </script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <table id="mydata">
    <tr><td><input id="x1" name="x1" value="x1" type="checkbox" class="use_bold">Use Bold</td><td><input id="y1" name="y1" value="y1" type="checkbox" class="use_red">Use Red</td></tr> 
    
    <tr><td><input id="x2" name="x2" value="x2" type="checkbox" class="use_bold">Use Bold</td><td><input id="y2" name="y2" value="y2" type="checkbox" class="use_red">Use Red</td></tr>
  
    <tr><td><input id="x3" name="x3" value="x3" type="checkbox" class="use_bold">Use Bold</td><td><input id="y3" name="y3" value="y3" type="checkbox" class="use_red">Use Red</td></td></tr>

  </table>

  Bold<input name="collected_data_bold" type="text"><br>Red
  <input name="collected_data_red" type="text">
</div>
</body>
</html>

Open in new window

You can parse the data however you want to in the form post.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
ado.net AddWithValue when using IN condition 7 43
Shared Service Environment 2 53
Put File 6 34
Difference between Highcharts and Mapbox 10 43
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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!
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 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