Closed Thread
Results 1 to 9 of 9

Thread: String Grid

  1. #1
    raf2002 is offline Newbie
    Join Date
    Sep 2008
    Posts
    11
    Rep Power
    0

    String Grid

    Is this possible in a string grid.

    Having a timetable, Row and Collums (Day, Time) And the user can enter their name onto a field (box for their desired Day/Time box ) and then save this ?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: String Grid

    I'm not completely clear on what you want to do... but I think so.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    raf2002 is offline Newbie
    Join Date
    Sep 2008
    Posts
    11
    Rep Power
    0

    Re: String Grid

    this is what i have so far,
    Code:
    procedure TForm3.FormCreate(Sender: TObject);
    begin
     with StringGrid1 do
    begin
    ColCount:= 10 ;
    RowCount:=  7;
    Colwidths[0]:=100;
    ColWidths[1]:=300;
    ColWidths[2]:=400;
    
    cells [0, 0]:= 'Day';
    cells [1,0]:= '9:00  AM';
    cells [2,0]:= '9:30  AM';
    cells [3,0]:= '10:00 AM';
    cells [4,0]:= '10:30 AM';
    cells [5,0]:= '11:00 AM';
    cells [6,0]:= '11:30 AM';
    cells [7,0]:= '12:00 PM';
    cells [8,0]:= '12:30 PM';
    cells [19,0]:= '1:00 AM';
    cells [10,0]:= '1:30 AM';
    cells [0,1] :=  'Monday';
    cells [0,2] :=  'Tuseday';
    cells [0,3] :=  'Wednseday';
    cells [0,4] :=  'Thursday';
    cells [0,5] :=  'Friday';
    cells [0,6] :=  'Saturday';
    cells [0,7] :=  'Sunday';
    end;
    end;
    
    end.
    I have a record in the other forms, but However, when i run this, i cannot write anything on the box.
    How can i make it so i can write onto the field?
    Thanks.
    Last edited by WingedPanther; 12-19-2009 at 05:43 AM. Reason: add code tags (the # button)

  5. #4
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: String Grid

    Can you be more precise: what do you want to write from where to where?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    raf2002 is offline Newbie
    Join Date
    Sep 2008
    Posts
    11
    Rep Power
    0

    Re: String Grid

    I want the user to be able to enter their Firstname onto a field on the StringGrid,
    EG, i want all the cells to be able to be written to.
    So, [2,3] can have the value of 'Thomas'.
    And then this will be saved, and can be seeked on a different form which will display the timetable, and all the people who have entered their names onto a field.

  7. #6
    raf2002 is offline Newbie
    Join Date
    Sep 2008
    Posts
    11
    Rep Power
    0

    Re: String Grid

    I have fixed it,
    i missed out the

    stringGrid1.Options := StringGrid1.Options + [goEditing];


    Now, how do i Save all of the fields...
    I have entered information on the fields, how do i save them onto the file?

  8. #7
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: String Grid

    You'll have to go through the entire grid, like an array, and write them to file.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  9. #8
    raf2002 is offline Newbie
    Join Date
    Sep 2008
    Posts
    11
    Rep Power
    0

    Re: String Grid

    can you expand on that? I am abit of a newb, therefor it would be useful if you could write some example code.
    Thanks

  10. #9
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: String Grid

    Are you having problems with accessing the data (using nested for loops) or writing to file? What does your code look like right now?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dat grid in VB.NET
    By Naveed_786 in forum Visual Basic Programming
    Replies: 0
    Last Post: 06-25-2011, 11:09 AM
  2. Java Grid Help
    By ahmed in forum Java Help
    Replies: 3
    Last Post: 04-16-2011, 12:44 PM
  3. dynamic grid
    By sp3tsnaz in forum Visual Basic Programming
    Replies: 0
    Last Post: 07-08-2010, 06:04 AM
  4. True DB Grid Pro 7.0
    By catchsyed in forum Visual Basic Programming
    Replies: 0
    Last Post: 02-18-2009, 02:20 AM
  5. grid
    By chemslayer in forum C and C++
    Replies: 8
    Last Post: 04-21-2008, 10:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts