Search:
Type: Posts; User: rafter_01
Search:
Search took 0.02 seconds.
-
update:
JMC, you'll probably lambast me for this but i somehow got this working with the following code under the form load event:
For Each row As DataGridViewRow In...
-
better late than never..
ill crack on with the next part now and will post what ive done..
thanks JMC
-
-
right,
is this what you meant:
Private Sub SetCellBackColors(ByVal rowindex As Object, ByVal columnindex As Object)
Dim cell As DataGridViewComboBoxCell =...
-
JMC,
not done a 'for loop' before, can you please help me with the code?
googled it but not entirely sure how i implement this in form load.
understand that i need to loop for the row index
-
and i'm calling the method in cellvaluechanged event handler:
SetCellBackColors(e.RowIndex, e.ColumnIndex)
and tested this event handler and it works the same way.. brilliant.. onto the next...
-
sorry got a million things going on, i got confused between variables + parameters, is this better:
Private Sub SetCellBackColors(ByVal rowindex As Object, ByVal columnindex As Object)
...
-
hey thanks for your reply, created a method:
Private Sub SetCellBackColors()
Dim columnIndex As ????
Dim rowindex As Integer ????
If rowindex <> -1 AndAlso...
-
one step at a time:
to loop through for the row index, is the following code correct:
For Each row As DataRow In DataGridView1.Rows
Next row
now how would i add this to the...
-
oh ok cool.. bit over my head this is..
-
JMC,
with your kind help, the following code was created:
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles...
-
previously you helped me with changing a combobox cell color when the value was changed. Just wanted to do something similar. Such as automatically set the color of a cell depending on the value when...
-
Morning,
if i want to make a change to a cell in a datagridview when the form loads, how would i go about doing this?
-
Niya,
apart from putting the code in the form load instead of VALUECHANGED event, im pretty sure the only modification i need to make is with this line:
Dim cell As DataGridViewComboBoxCell =...
-
yes..
but i want to do this when the form loads. So when the form loads if the combobox value is 'paid' then show the cell color green and if its 'unpaid' then red.
-
with the help of JMC, the code i created to change cell color based on value is:
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As...
-
to get to the cell ive used the following code for VALUECHANGED event:
Dim cell As DataGridViewComboBoxCell = DataGridView1(e.ColumnIndex, e.RowIndex)
how would i get to the cell if i want it...
-
oh ok cool,
im doing something similar to this by changing the color of one my textbox columns but can't seem to get it to work:
Dim thirdColumn As Integer = 1
Dim column As...
-
No problems Niya, that works many thanks...
now that i can get the datagrid combobox to change color when i select something, what if i wanted to show "Unpaid" to be green and "Paid" to be red...
-
Niya, any update on this?
-
sorry got it working now:
line missing was:
If retrievedValue = False Then
......
JMC thankyou for your help throughout this thread.
-
thanks JMC, changes made:
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
...
-
Right JMC, hope ive got this right, dont wanted to be slated:
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)...
-
cool, so far my code looks like this:
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles...
-
is the type: DataGridViewComboBoxCell
found the info from: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.items.aspx
-
-
btw, ive just noticed the following error is what i get when running just the above code:
An error occurred creating the form. See Exception.InnerException for details. The error is: Index was...
-
-
I'm kind of lost at this point, you make the point that the cell bit is:
DataGridView1(e.ColumnIndex, e.RowIndex)
firstly am i doing the conversion right? what type will my variable be?
...
-
okay coz the value in that cell is a string value would my variable be?:
Dim value As String = e.ColumnIndex
-
Hi,
what type of variable would i assign the cell to? Also, would i create this variable within the CellvalueChanged event?
-
JMC, quite frankly tbh, i got this little example of code from the net and the guy who posted it explained it by breaking it down, i understood it much quicker... but no doubt you're very helpful and...
-
what ive done so far:
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
...
-
Just read this, thanks for your reply.
What you're actually asking for is not an example but for someone to write a copy and paste solution for you. That someone won't be me.
i completely...
-
been looking at this all afternoon but still struggling, JMC i understand what you're saying but im fairly new to VB so struggling to execute what you are trying to say..
can someone please post...
-
thanks for this info,
possible you can show me an xample?
-
understand your explanation but not sure if i'm coding it right:
Dim test As New DataGridViewComboBoxCell
test = Column1.DataSource
If test.DisplayMember = "Paid" Then
...
-
Afternoon,
how do i get the selectedindex/item of a datagridview combobox column?
what i want to do is change the back color of datagridcombobox when something is selected from the combobox?
...
-
hah, thanks for this.
so just say i wanted to update 'column1' of the selected rows from one to word to another for example "one" to "two". Would i use the row.index as a reference?
-
oh ok and through code how would i refer to the selected rows?
|
Click Here to Expand Forum to Full Width
|