将数据从SQL表加载到网格视图并使其可编辑。 [英] Load data from SQL table to grid view and make it editable.

查看:91
本文介绍了将数据从SQL表加载到网格视图并使其可编辑。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨亲爱的,



由于这个原因,我被困在项目中间。实际上我有一个SQL表,我希望我的C#代码动态加载到gridview。我使用一个简单的选择查询。所以现在我想让gridview可编辑。每次我的表名根据用户选择而改变,所以我不会在Sqldatasource的帮助下寻找任何手动活动。



我想要一个正确的方法让我的Gridview可编辑。



请给我推荐一下。



我尝试了什么:



直到现在我能够在gridview中绑定我的sql表,我可以看到绑定列中的所有值。想要在所有行前面有一个编辑选项,并使行可编辑。

Hi Dears,

I am stuck in the middle of my project due to this. Actually i have a SQL table and i want my C# code to dynamically load into gridview. This i have done using a simple select query. SO now i want to make the gridview is editable. Every time my table name changes as per user selection, so i am not looking for any manual activities with the help of Sqldatasource.

I want a proper way to make my Gridview editable.

Please suggest me something.

What I have tried:

Till now i can able to bind my sql table in gridview, I can see all the values in bound column. Want an edit option in front of all the rows and make the rows editable.

推荐答案

正如您所说的gridview我假设您正在使用ASP .NET。



GridView内置了一个编辑选项 - 请参阅文档 ASP.NET 2.0的GridView示例:编辑GridView中的基础数据 [ ^ ]
As you are referring to a "gridview" I'm assuming you are using ASP.NET.

The GridView has an edit option built in - see the documentation GridView Examples for ASP.NET 2.0: Editing the Underlying Data in a GridView[^]


这篇关于将数据从SQL表加载到网格视图并使其可编辑。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆