本文介绍了如何从Windows窗体中的列表加载datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从数据库加载datagrid视图,但是当我运行以下代码时,它会显示列中字符串的长度。
I want to load datagrid view from database but when i run the following code, it shows the length of the string in the columns.
Entities db = new Entities(); var dtstr = db.Shops.Select(d => d.ShopName).ToList(); dataGridView1.DataSource = dtstr.ToList(); dataGridView1.Refresh();长度 5 5 4 5 另外如何在windows窗体中的datagridview中编辑和删除功能。 感激, Usama
Length 5 5 4 5 Also how can is had edit and delete functionality in datagridview in windows form. Thankful, Usama
推荐答案试试这个: ASP.NET 2.0中的可编辑GridView [ ^ ] 或 Link2 [ ^ ] Try this : Editable GridView in ASP.NET 2.0[^] or Link2[^]
更多推荐
如何从Windows窗体中的列表加载datagridview
发布评论