English 中文(简体)
在Gridview中只绑定表的3列
原标题:Databind only 3 columns of a table in Gridview

Hey i have a simple ASP.NET application Table with this schema: id | Owner | Customer | SentOn | Deleted |. I want the gridview to show only Owner | Customer | SentOn columns of the DataTable which is inside the DataSet. How can i do this?


Note: I want to do this programmatic without any dataSource Controls. I want to display CheckBox column for Deleted field, is this possible

最佳回答

将“自动生成列”设置为“false”。为要显示的每列添加一个BoundField,并为“已删除”列添加CheckBoxField。

问题回答

哈哈:我想D只是使用了一个DataBound字段。否则,将UnUsed列的visible属性设置为False





相关问题
Reading an XLS file with the Microsoft Jet Engine

I want to allow my application to import data from XLS files. I already do this with CSV files and XML files, but would like to open the scope for users. I am having trouble with loading the file. ...

Saving nested XML in C#

I ve go the following XML file... <A> <B> <C>ValueX</C> <D>ValueY</D> </B> </A> Which I read into a DataSet to display it in a ...

Datasets do not regenerate code behind

So I was lucky enough to inherit a project where someone decided to use datasets as a model. The problem is that a column has been added to table in the database. Using the dataset desinger I added ...

DataSet and Primary Key with multiple columns

How Can I use Find method in DataSet that has Primary Key make of 3 Columns? dadSample.SelectCommand = New SqlCommand("SELECT * FROM StockBalance", conxMain) dadSample.FillSchema(...

Is List<> better than DataSet for UI Layer in ASP.Net?

I want to get data from my data access layer into my business layer, then prepare it for use in my UI. So i wonder: is it better to read my data by DataReader and use it to fill a List<BLClasses&...

热门标签