如何从Windows窗体中的列表加载datagridview

编程入门 行业动态 更新时间:2024-10-28 15:29:23
本文介绍了如何从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

本文发布于:2023-11-04 21:43:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559091.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   加载   列表   Windows   datagridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!