If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Move flexgrid rows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-26-04, 08:46
yoja7 yoja7 is offline
Registered User
 
Join Date: Jan 2004
Location: India
Posts: 31
Move flexgrid rows

hi all

i am faced with a boring problem

User adds/ removes items from a flexgrid. They r of diffrent backcolor....depending on category
User wants also the facility to move rows Up and Down
I have figured that out
but i am not able to change color as per the row movement

please see screenshot
thanks
Yogesh Jangam
Attached Images
File Type: jpg screenshot.JPG (13.3 KB, 224 views)
__________________
Do not walk behind me, for I may not lead.
Do not walk ahead of me, for I may not follow.
Do not walk beside me, either.
Just leave me alone.

Yogesh Jangam
http://yogeshjangam.*************
Reply With Quote
  #2 (permalink)  
Old 07-26-04, 23:56
yoja7 yoja7 is offline
Registered User
 
Join Date: Jan 2004
Location: India
Posts: 31
Unhappy

no reply

any way
i will elaborate again.

User will click the required row and either click move up or down.....
I am able to do taht with below code
Code:
Public Sub MoveRow(intFrom As Integer, intTo As Integer)
Dim tmpQID As Integer
Dim tmpQText As String
Dim tmpRowCol As Long

If intTo <> 0 Or intTo <> msfTestQuestions.Rows - 1 Then
With msfTestQuestions
  tmpQID = .TextMatrix(intTo, 1)
  tmpQText = .TextMatrix(intTo, 2)
  tmpRowCol = .BackColor ' ???? help here
  
  .TextMatrix(intTo, 1) = .TextMatrix(intFrom, 1)
  .TextMatrix(intTo, 2) = .TextMatrix(intFrom, 2)
  .TextMatrix(intFrom, 1) = tmpQID
  .TextMatrix(intFrom, 2) = tmpQText
End With
End If
End Sub
i call this function to move up or down
for ex....to move up
Code:
Call MoveRow(msfTestQuestions.Row, msfTestQuestions.Row - 1)
now i need is to move the color also
something like swap color

i have tried .Backcolor , .CellBackcolor

please help
some one
btw yellow color indicates selected row
__________________
Do not walk behind me, for I may not lead.
Do not walk ahead of me, for I may not follow.
Do not walk beside me, either.
Just leave me alone.

Yogesh Jangam
http://yogeshjangam.*************
Reply With Quote
  #3 (permalink)  
Old 07-31-04, 21:47
MTaylor MTaylor is offline
Registered User
 
Join Date: May 2004
Posts: 97
You are trying to change the back color of the ROW and you cannot do that. You will have to loop from col 0 to col max and change the back color with CellBackColor property.

The BackColor property affects ALL non fixed cells. BackColorSel is the color of the selected row, and BackColorBkg is the background color.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On