Results 1 to 4 of 4

Thread: How can I add Check box in a Datagrid?

  1. #1
    Join Date
    Nov 2009
    Posts
    712

    How can I add Check box in a Datagrid?

    Hi Friends,


    I am designing one application. In which I have to add a Check box into the Datagrid. I have tried different techniques but didn't helpful.

    Please let me know How can I add Check box in a Datagrid?

    I am waiting for your reply..

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: How can I add Check box in a Datagrid?

    Hi,

    Use the below code to add Check box in the datagrid:

    Code:
    DGTableStyle tstyle = new DGTableStyle();

    discontinuedCol.MappingName = "chckbox";

    DGBoolColumn chckboxCol=new DGBoolColumn();

    discontinuedCol.HeaderText = " ";

    chkboxCol.AllowNull = false;

    discontinuedCol.Width = 40;

    tstyle .GridColumnStyles.add(chckboxCol);

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How can I add Check box in a Datagrid?

    Hi friend,

    Hi friend,

    First you will need to include "Item Template" in the Datagrid of your application. Then only you are able to include Check box within the "Item Template". I did same thing which is as follows:

    Dim str1 as string =" "
    dim it as datagriditem
    dim ch as checkbox
    for each item in datagd1.items
    ch=cTp(it.fndcontrol("ch"),checkbox)
    if ch.checked=True then
    str1=str1 & " , " & it.cells(2).text
    end if
    next
    Response.write(str1)

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: How can I add Check box in a Datagrid?

    Hi,

    Please follow below instruction to add add Check box in a Datagrid:

    *. First create application using In Visual Studio as:
    Open Menu File then select project option then choose C sharp and finally click on Windows Form Application.

    *. After this process include "DataGridView" option from toolbox of Visual Studio. Then you have to add button for testing the value of Check Box from DatGridView.

Similar Threads

  1. Datagrid VS Gridview
    By Techno Guru in forum Software Development
    Replies: 5
    Last Post: 16-01-2010, 12:42 PM
  2. How to print web datagrid in VB.NET
    By spuff in forum Windows Software
    Replies: 3
    Last Post: 31-07-2009, 11:33 AM
  3. How to Export datagrid to pdf
    By Integer in forum Software Development
    Replies: 3
    Last Post: 17-03-2009, 07:58 PM
  4. How can I get the row count from DataGrid?
    By Shashikant in forum Software Development
    Replies: 4
    Last Post: 04-02-2009, 11:47 PM
  5. Add ComboBox in DataGrid in VB 6.0
    By Jateen in forum Software Development
    Replies: 3
    Last Post: 15-01-2009, 06:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,049,814.12037 seconds with 17 queries