Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TCustomGrid(TStringGrid).MoveRow(...)

Posted on 1999-08-22
5
Medium Priority
?
488 Views
Last Modified: 2010-05-18
Once again, I'm caught by surprise by Delphi 3. I have a form with a TStringGrid and I try to use the MoveRow-method (of the TCustomGrid?) from another datamodule. Why do I get an 'undeclared identifier: MoveRow'-error?

I have Grids in the 'uses' section of the datamodule as well, and I can do simple things on the TStringGrid, so that should not be the problem.

Here are two of my numerous attempts, which all have been blocked by the same error from the compiler:
   Form1.StringGrid1.MoveRow(i, j);
   TCustomGrid(Form1.StringGrid1).MoveRow(i, j);
0
Comment
Question by:AValoN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1395756
hi avalon,

its just a protected method,
i guess, you must derive a own grid

meikl

0
 

Author Comment

by:AValoN
ID: 1395757
Ok, that could be the fault. Do you think it will be fixed if I choose Create New Component, use TStringGrid as a super-class and just add the line
  procedure MoveRow(FromIndex, ToIndex: Longint);
to the Published-part (declaration line from the help-file)? Of course I'm also changing the TStringGrids to these new TSpecialStringGrids before trying out...

0
 

Author Comment

by:AValoN
ID: 1395758
After some tinkering here and there (making the new component, declaring the method published and making it use the Inherited + quick changes on the form in text mode), the compiler liked my typings! :)

kretzschmar:
Points are yours to collect. I assume that .deleteRow a few lines later has just the same problem (it's protected as well) and now I know how to fix it...

0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 240 total points
ID: 1395759
yup avalon,

glad to help,
good luck on deriving your extended grid

meikl ;-)
0
 

Author Comment

by:AValoN
ID: 1395760
Thanks! Once again, it was not much, but something quite fundamental was not right.

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question