By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,730 Members | 1,156 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,730 IT Pros & Developers. It's quick & easy.

Filtering an editable datagrid

P: n/a
I'm sure it can be done, I haven't been able to find the right article yet.

I want to be able to filter the records that the datagrid displays, but
still have an editable datagrid. That is, I only want records from the
table where "State= 'CA'" are to be displayed, but where the user can still
edit/add/delete records.

The only examples I have found utilizes DataViews, which apparently are not
editable. Can someone point me to the proper article?

TIA,

Richard Rosenheim
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Richard,

Why is with you using the dataview the datagrid not editable?

Cor

"Richard L Rosenheim" <ri*****@rlr.com> .
I'm sure it can be done, I haven't been able to find the right article yet.
I want to be able to filter the records that the datagrid displays, but
still have an editable datagrid. That is, I only want records from the
table where "State= 'CA'" are to be displayed, but where the user can still edit/add/delete records.

The only examples I have found utilizes DataViews, which apparently are not editable. Can someone point me to the proper article?

TIA,

Richard Rosenheim

Nov 21 '05 #2

P: n/a
Hi,

The dataview is editable. You also could filter the datagrid if you
are bound to a dataset.table(tablename) by using the
datatable.defaultview.rowfilter

Ken
---------------------
"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm sure it can be done, I haven't been able to find the right article yet.

I want to be able to filter the records that the datagrid displays, but
still have an editable datagrid. That is, I only want records from the
table where "State= 'CA'" are to be displayed, but where the user can still
edit/add/delete records.

The only examples I have found utilizes DataViews, which apparently are not
editable. Can someone point me to the proper article?

TIA,

Richard Rosenheim

Nov 21 '05 #3

P: n/a
Hi all,

Am I doing something wrong here? I'm just trying to filter my datagrid with
the DefaultView.RowFilter method.

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
DataGrid1.DataSource = m_dt
DataGrid1.DataMember = "Orders"
Dim myFilter = "CustomerID = " & m_bo.CustomerID
m_dt.DefaultView.RowFilter = myFilter
End Sub

rodchar

"Ken Tucker [MVP]" wrote:
Hi,

The dataview is editable. You also could filter the datagrid if you
are bound to a dataset.table(tablename) by using the
datatable.defaultview.rowfilter

Ken
---------------------
"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm sure it can be done, I haven't been able to find the right article yet.

I want to be able to filter the records that the datagrid displays, but
still have an editable datagrid. That is, I only want records from the
table where "State= 'CA'" are to be displayed, but where the user can still
edit/add/delete records.

The only examples I have found utilizes DataViews, which apparently are not
editable. Can someone point me to the proper article?

TIA,

Richard Rosenheim

Nov 21 '05 #4

P: n/a
What is m_dt?

With datatables and datagrids, the RowFilter methods takes a string. The
following should work::
m_dt.DefaultView.RowFilter = "CustomerID=" & m_bo.CustomerID.ToString

Richard Rosenheim


"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...
Hi all,

Am I doing something wrong here? I'm just trying to filter my datagrid with the DefaultView.RowFilter method.

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
DataGrid1.DataSource = m_dt
DataGrid1.DataMember = "Orders"
Dim myFilter = "CustomerID = " & m_bo.CustomerID
m_dt.DefaultView.RowFilter = myFilter
End Sub

rodchar

"Ken Tucker [MVP]" wrote:
Hi,

The dataview is editable. You also could filter the datagrid if you are bound to a dataset.table(tablename) by using the
datatable.defaultview.rowfilter

Ken
---------------------
"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm sure it can be done, I haven't been able to find the right article yet.
I want to be able to filter the records that the datagrid displays, but
still have an editable datagrid. That is, I only want records from the
table where "State= 'CA'" are to be displayed, but where the user can still edit/add/delete records.

The only examples I have found utilizes DataViews, which apparently are not editable. Can someone point me to the proper article?

TIA,

Richard Rosenheim

Nov 21 '05 #5

P: n/a
Thanks for the replies. I'm making some headway.

One of my mistakes was that to keep the datatable ID columns from appearing
in the grid, I set the column mapping for those columns to hidden. That had
some negative side effects. I guess I'm going to have to manipulate the
grid style to just hide the columns there.

The other problem I'm having is that the datagrid column containing the
parent ID is not automatically populated. At some point, when an user
enters a new row, I'm going to have to populate that column (and presumably
before it's actually added to the dataset). Can someone point in the right
direction? I didn't see any events which would appear to be of help.
TIA,

Richard Rosenheim
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uO**************@TK2MSFTNGP11.phx.gbl...
Hi,

The dataview is editable. You also could filter the datagrid if you are bound to a dataset.table(tablename) by using the
datatable.defaultview.rowfilter

Ken
---------------------
"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm sure it can be done, I haven't been able to find the right article yet.
I want to be able to filter the records that the datagrid displays, but
still have an editable datagrid. That is, I only want records from the
table where "State= 'CA'" are to be displayed, but where the user can still edit/add/delete records.

The only examples I have found utilizes DataViews, which apparently are not editable. Can someone point me to the proper article?

TIA,

Richard Rosenheim

Nov 21 '05 #6

P: n/a
Thanks for the replies. I'm making some headway.

One of my mistakes was that to keep the datatable ID columns from appearing
in the grid, I set the column mapping for those columns to hidden. That had
some negative side effects. I guess I'm going to have to manipulate the
grid style to just hide the columns there.

The other problem I'm having is that the datagrid column containing the
parent ID is not automatically populated. At some point, when an user
enters a new row, I'm going to have to populate that column (and presumably
before it's actually added to the dataset). Can someone point in the right
direction? I didn't see any events which would appear to be of help.
TIA,

Richard Rosenheim
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uO**************@TK2MSFTNGP11.phx.gbl...
Hi,

The dataview is editable. You also could filter the datagrid if you are bound to a dataset.table(tablename) by using the
datatable.defaultview.rowfilter

Ken
---------------------
"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm sure it can be done, I haven't been able to find the right article yet.
I want to be able to filter the records that the datagrid displays, but
still have an editable datagrid. That is, I only want records from the
table where "State= 'CA'" are to be displayed, but where the user can still edit/add/delete records.

The only examples I have found utilizes DataViews, which apparently are not editable. Can someone point me to the proper article?

TIA,

Richard Rosenheim

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.