473,569 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataView Row Filter isn't working

Kim
I need to filter this datatable but when I do it gives me all the data
not filter not sure what Im doing wrong.
DataView dv = new DataView();
dv.RowFilter = "ClientID = " + clientid;
gridControl1.Da taSource = dv;

I also tried adding this but it didn't work either:
dv.RowStateFilt er = DataViewRowStat e.ModifiedCurre nt;

when I added the Row State Filter after the Row Filter no records was
return.
Any help will be greatly appreciated.
Thanks
Kim

Nov 17 '05 #1
3 5969
What about datatable? where is it? My advice u to use DefaultView property
of datatable

--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

"Kim" <gi***@aol.co m> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I need to filter this datatable but when I do it gives me all the data
not filter not sure what Im doing wrong.
DataView dv = new DataView();
dv.RowFilter = "ClientID = " + clientid;
gridControl1.Da taSource = dv;

I also tried adding this but it didn't work either:
dv.RowStateFilt er = DataViewRowStat e.ModifiedCurre nt;

when I added the Row State Filter after the Row Filter no records was
return.
Any help will be greatly appreciated.
Thanks
Kim

Nov 17 '05 #2
I modified this for you from some working production code:

<code>
DataView dv = new DataView( %DATATABLE% , %FILTER_STRING% ,
%ORDER_BY_STRIN G% , DataViewRowStat e.CurrentRows );
gridControl1.Se tDataBinding( this.currentVie w , null );
</code>

Replace the %...% markers above with your variabIes and use the
SetDataBinding method instead of just setting the DataSource property.
Works great for me...

HTH,
Joel

Nov 17 '05 #3
Hello,
Have you tried putting single quotes around clientID?

something like
dv.RowFilter = "ClientID = '" + clientID + "'";??

Trying using it, it should help.

Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11436
by: Vern | last post by:
The following code retrieves data into a dataset, and then creates a dataview with a filter. This dataview is then attached to a combobox. When the effective date changes, I would like to see the newly filtered data without having to create a new dataview each time. Is that possible? Also, do I need to attach the dataview to the combo box...
2
3282
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit the selected lie item at which case I would pop up a separate dialog box to do so, in the debugging code, the dataview.count would return 0. I get...
5
8818
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it happen. Dim objKeys(2) as Object objKeys(0) = "CL" objKeys(2) = 4000 Dim posView As DataView = New DataView(posDS.Tables("Positions"), _
17
2739
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only allow user to filter the first time, when they tried the second time, the speficied cast error message will prompt one.... I create a mydataset1...
1
1766
by: Islamegy® | last post by:
I have 2 Questions.. 1- Is it better to use Dataview To filter and sort Datatables or requery the datasource?? When i was working in windows appl i found sorting and filtering on client old machine is slow and need proccessor usage now in asp.net the load is centralized on the web Server, what is the best way for filter/sort data?? 2- In...
3
1625
by: koredump | last post by:
Hi, I'm working on fixing a bug in a very data intensive windows application. The application has a datagrid that binds to a dataview. The dataview can hold as many as 40000 records that are retrieved from two tables with a join. The user filters the dataview to display a subset of the 40000 records. All data gets loaded on FormLoad(). ...
3
10231
by: randy1200 | last post by:
I have a DataView (dv) that includes a StartDate DateTime column. I'd like to return the DataView record that contains a StartDate value closest to my IncidentDate value: string filter = String.format("StartDate nearest {0}", IncidentDate); dv.Rowfilter = filter; Of course, there's no nearest function.
1
2699
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a global dataview is created -The user enters new part information into a form. -A function is called to check to see if the part is a new part (so...
5
11822
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a global dataview is created -The user enters new part information into a form. -A function is called to check to see if the part is a new part (so...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
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 we have to send another system
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.