P
Peter
I have data grid and trying to create a search function, the problem I am having is when my table is not sorted in by the primary key I get the closest match in the current order.
Is there a way I can search the DataGrid for exact value and not have it sorted?
Here's my code:
DataTable tbl = this.dvOpenOrders.Table;
object[]findKey = new object[1];
DataColumn[] dcolPk = new DataColumn[1];
dcolPk[0] = tbl.Columns["doc_code"];
tbl.PrimaryKey = dcolPk;
tbl.DefaultView.Sort = "doc_code";
findKey[0] = doc_code;
row = tbl.DefaultView.Find(findKey);
Thanks
Peter
Is there a way I can search the DataGrid for exact value and not have it sorted?
Here's my code:
DataTable tbl = this.dvOpenOrders.Table;
object[]findKey = new object[1];
DataColumn[] dcolPk = new DataColumn[1];
dcolPk[0] = tbl.Columns["doc_code"];
tbl.PrimaryKey = dcolPk;
tbl.DefaultView.Sort = "doc_code";
findKey[0] = doc_code;
row = tbl.DefaultView.Find(findKey);
Thanks
Peter