Row filter in Dataset

Here it will be useful for someone who would like to filter a particular record in datagrid. You need to create a dataview and filter it. Here, i would like to filter a particular record where the field name is “metakey” and i don’t want to show it when its value is “thumbnail”. So a record where metakey is thumbnail will not be shown at all. It’s a simple thing but it will be useful.

DataSet metaData = new DataSet();
dv = new DataView(metaData.Tables[0]);

gridMeta.DataSource = dv;
gridMeta.DataBind();

dv.RowFilter = ("metakey  'thumbnail'");
//bind it to datagrid

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s