Checkbox and Text in Grid

8 posts, 0 answers
  1. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 22 Nov 2011 Link to this post

    I just have one checkbox and a text that comes in a datasource. Can I use a grid to get the following style?

    CB1 Text1    CB2 Text2
    CB3 Text3    CB4 Text4

    ...
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Nov 2011 Link to this post

    Hello Deepak,

    You can achieve this using GridTemplateColumn as explained in this documentation.
    Customizing with GridTemplateColumn

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 24 Nov 2011 Link to this post

    Shinu,

    Thanks for the layout example. But is there a way we can stipulate that three records will go in the horizontal way and then the next three records in the next line (as I have illustrated with a figure in my original post)?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Nov 2011 Link to this post

    Hello Deepak,

    Here is the sample code.
    aspx:
    <telerik:GridTemplateColumn>
     <ItemTemplate>
       <table cellspacing="1" >
          <tr>
             <td>
               <asp:CheckBox ID="CheckBox1" runat="server" />
                <asp:Label ID="Label1" runat="server" Text='<%# Eval("LastName") %>'></asp:Label>
              </td>
           </tr>
       </table>
     </ItemTemplate>
    </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn>
     . . . .
    </telerik:GridTemplateColumn>

    -Shinu.
  6. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 30 Nov 2011 Link to this post

    Dear Shinu,

    Your code will render as

    [X] Shinu
    [X] Lavanya
    [X] Deepak
    [X] Microsoft

    right? I would need the following type of rendering:

    [X] Shinu [X] Lavanya
    [X] Deepak [X] Microsoft
  7. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 05 Dec 2011 Link to this post

    Hi Deepak,

    In order to achieve your goal, and have better control on the data visualization, as well get better performance for your case, I would suggest that you utilize our RadListView control. Try the attached sample.

    Let me know if this works for you and if you need to enable additional features for the RadListView, like paging selection, etc.

    Greetings,
    Iana Tsolova
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  8. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 05 Dec 2011 Link to this post

    Thanks Iana.

    Do we have header footer templates for ListView?
  9. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 06 Dec 2011 Link to this post

    Hello Deepak,

    RadListView has a layout template where you can define the header and footer. You can also use it predefined layouts and make it look like RadGrid, with Skin applied. For more information you can refer to the below resources:
    http://demos.telerik.com/aspnet-ajax/listview/examples/templates/datalayouttemplates/defaultcs.aspx
    http://demos.telerik.com/aspnet-ajax/listview/examples/appearancestyling/predefinedlayouts/defaultcs.aspx
    http://www.telerik.com/help/aspnet-ajax/listview-data-and-layout-templates.html
    http://www.telerik.com/help/aspnet-ajax/listview-edit-and-insert-templates.html
    http://www.telerik.com/help/aspnet-ajax/listview-predefined-layouts.html
    http://www.telerik.com/help/aspnet-ajax/listview-skins.html


    Kind regards,
    Iana Tsolova
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017