如何使数据网格中的列成为复选框?

时间:2018-08-19 14:28:27

标签: c# sql-server winforms datagridview

我有一个DataGridView

First pic

我要实现的结果是

Second Pic

但是每次我使用存储过程运行代码时,它都会变成这样 Third Pic

有用于填充表格的代码

private void btnReturnSearch_Click_1(object sender, EventArgs e)
    {
        dgvCurrentBorrowed.DataSource = db.sp_ViewBorrowedEquipment(int.Parse(txtReturnID.Text));
    }

这是存储过程

CREATE PROC sp_ViewBorrowedEquipment
(
    @TransactionID int
)
as
SELECT TBLEQUIPMENTDETAILS.EQUIPMENT_ID as 'ID', TBLEQUIPMENTDETAILS.EQUIPMENT_NAME as 'Name', TBLBORROWED.Quantity, TBLBORROWED.IsGoodCondition as 'Returned?', TBLBORROWED.IsGoodCondition AS 'Good Condition?' FROM TBLBORROWED
INNER JOIN TBLEQUIPMENTDETAILS ON TBLBORROWED.EQUIPMENT_ID=TBLEQUIPMENTDETAILS.EQUIPMENT_ID
INNER JOIN TBLTRANSACTION ON TBLBORROWED.TransactionID=TBLTRANSACTION.TransactionID
WHERE TBLTRANSACTION.TransactionID=@TransactionID

任何评论或任何想法都将真正帮助

0 个答案:

没有答案