473,472 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filtering an editable datagrid

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
6 1596
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andla Rand | last post by:
Hi, Could you help me to understand how datagrid works. I'm trying to make a datagrid editable. Now most of the tutorials I read says that i should turn the Enable ViewState off. Why is that? ...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
4
by: Stephan Bour | last post by:
Hi, I have a datagrid databound to a SQL query. I'd like to allow editing of some columns but not all. Is there a way to turn off the conversion of the datagrid cells to textboxes for some columns...
2
by: Jesper Stocholm | last post by:
I have a challenge, that I do not seem to be able to solve. I have an "overview"-page that presently displays data from 2 columns in a database table. The users should be allowed to edit data in...
0
by: DaveR | last post by:
I have a webform with a two-column datagrid based on an Arraylist. The Arraylist draws the data for the two columns from two different tables in an SQL database. The data is displayed in datagrid...
2
by: Carlo Marchesoni | last post by:
I have an editable Datagrid and memorize its datasource with a Session variable. On each Page_Load I simply Bind the Datagrid. Everything works fine. The problem comes, when I have a lot of...
2
by: zambizzi | last post by:
....I can't seem to get my hands on a control I'm loading in an editable datagrid. Here's my datagrid control: <asp:datagrid id="GLRulesGrid" runat="server" autogeneratecolumns="False"...
7
by: Diane | last post by:
Hi- I've been struggling with this problem and none of the fixes posted seem to help out at all. Yet, it seems like such a simple problem... I have a DataGrid, and load it up with data on...
3
by: Damon Grieves | last post by:
Hi I have a large table which I wanted to filter and then edit the selected record. I'm using a form with several pull down fields linked to lookup tables which correspond to fields in the large...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.