When you bind a DataSet to a DataGrid, you are actually binding the default
view of the first table, if you do not specify. IE:
DataGrid1.DataSource = MyDataSet;
is equivalent to:
DataGrid1.DataSource = MyDataSet.Tables[0].DefaultView;
So, you can specify different views if you explicitly code. For example:
DataView MyDataView = new DataView(MyDataSet.Tables[0]);
MyDataView.Filter = "Country='USA'";
Now, only items with country equal to USA are displayed. You then bind to
DataGrid like so:
DataGrid1.DataSource = MyDataView;
In the help file, you can see a different constructor for the view. And, you
can create multiple views if you want different slices of the same data.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Pedor" <pe***@anonymous.net> wrote in message
news:E6**********************************@microsof t.com...
I want to display only data in the datagrid for specific records having a
common or identical data in a column. How do you do this programmaticaly using combination of the datagrid
object, dataadapter, sqlconnection objects in the ide design?
The walkthrough "Walkthrough: Using a DataGrid Web Control to Read and
Write Data" doesn't include this filter ofor specifc group of records. Thanks in advance.