|
-
Dec 29th, 2013, 02:55 PM
#1
Thread Starter
Junior Member
-
Dec 29th, 2013, 03:38 PM
#2
Re: Find And Get Data In Datagridview With Condition / Statement
I think you may be able to do this by adding a new column to the underlying data table and settings its expression property correctly.
DataColumn.Expression Property
Take a look at the IIF function; about 3/4 of the way down on that page.
The reason I say I think is because I don't quite understand what you want. In particular
2. Find Ranking B that have Value = Ranking A!
Row-2 [S2]
Can you elaborate?
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Dec 29th, 2013, 04:07 PM
#3
Thread Starter
Junior Member
Re: Find And Get Data In Datagridview With Condition / Statement
Thanks For Replay! 
I use S1 for example to explain my problem!
S1 Have Ranking A = 1
S1 Have Ranking B = 4
S1 Have Nilai A = 80
S1 Have Nilai B = 0.9
First : Check Did Ranking A = Ranking B [1=4] --> NO
Okay..
Then : Find Data In Ranking B Coulmn Where The Value = Ranking A in Row S1 ---> So Find Data In Ranking B Column Where The Value = 1
The answer is : A value of 1 is on Second Row.
The Second Row Is S2
S2 Have Ranking A = 3
S2 Have Ranking B = 1
S2 Have Nilai A = 70
S2 Have Nilai B = 0.8
Then : Find Difference between Nilai B Second Row and Nilai B in First Row ->> 0.9 - 0.8 = 0.1
Do you understand what i Mean?
-
Dec 29th, 2013, 04:36 PM
#4
Thread Starter
Junior Member
Re: Find And Get Data In Datagridview With Condition / Statement
Please Help Me Broo!!
I realy Don't Understand, This Is My Final Problem! Testing Phase On My research!!
-
Dec 29th, 2013, 05:28 PM
#5
Re: Find And Get Data In Datagridview With Condition / Statement
Where is this data coming from? Is there an underlying datatable or are these values added directly from some process?
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Dec 29th, 2013, 05:29 PM
#6
Re: Find And Get Data In Datagridview With Condition / Statement
Did you look at the DataColumn.Expression property? Will that work for you? Have you written any code for this? If so what does it look like? Does it do what you would expect? Do you have the data that is in the datagridview? Is it in a table or do you populate the grid manually? You are the one that know what needs to happen to the data; you have it fairly well laid out above in pseudo code, now you just need to code it. I hope you are not expecting some to do that for you, because that would defeat the reason I visit this site. Give it a go and if you get stuck, post relevant code and good questions.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Dec 29th, 2013, 07:36 PM
#7
Thread Starter
Junior Member
Re: Find And Get Data In Datagridview With Condition / Statement
I'm using MySQL to acces the data.. That picture in first post just example, this is the real my datagridview :

I have been try to solve this problem, but i dont understand:
Code:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
dgv.Columns.Add("Diff", "Diff")
For i As Integer = 0 To dgv.Rows.Count - 1
For j As Integer = 0 To dgv.Columns.Count - 1
If dgv.Rows(i).Cells(1).Value <> dgv.Rows(i).Cells(2).Value Then
WHAT NEXT?
End If
Next
Next
End Sub
Last edited by vher_way; Dec 29th, 2013 at 07:40 PM.
-
Dec 29th, 2013, 10:51 PM
#8
Re: Find And Get Data In Datagridview With Condition / Statement
Well, help has been offered but you have refused to heed it so far. If you're getting the data from the database then you should be binding it to the grid, in which case you should not be touching the grid at all for what you want. You should be working exclusively with the bound data. As has been said, if you want another column then add another column to the underlying DataTable that you have bound to the grid. You can then set the Expression property of that DataColumn to populate it based on the values in other columns. You've already been directed to the Expression property of the DataColumn class. Have you read the documentation for that property? I assume not but I have to wonder why not. You want help but you're not prepared to read something that will help you when someone points you to it. Don't just sit there waiting for someone to write your code for you.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|