Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Multiple lines of columns within a single row

Hi,

On the product page of the SRP Edit Table (https://products.srpcs.com/srp-edittable-control/) you show a screenshot of an edit table whose columns span 3 lines. How do you specify that a column should appear on the second line, for example?

I looked through the documentation but couldn't find anything.

Comments

  • It's not quite that simple. It works like this:
    • Define the SRP EditTable's Dimension property based on the maximum number of columns you want to appear in a single row. Note, do not confuse this this with the total number of columns in your record. Looking at the example from that link, the first row has 6 columns, the second row has 4 columns, and the third row has 1 column. However...if you look carefully enough, the Phone column is actually two columns because you can see that this has the same width as the State and Zip columns underneath. This is important when designing the overall layout (see below). Technically speaking, the maximum number of columns that appears in a single row is 7 but there are a total of 10 columns in the record.
    • Define the RowsToRecords property so the control knows how many physical rows represent a logical record. In the example, the value would be 3.
    • Since there are 7 columns per row and 3 rows per record, this gives you 21 columns per record. However, we only want 10 (in our example at least). So how is this accomplished? Via the CellMerge property. This is why you see some columns span the width of 2 or more columns. This takes some planning to make it look balanced.
  • edited May 2019
    < saving that explanation away >
    Good subject for a tutorial!
  • edited May 2019
    Oh that sounds complicated ):

    Once I do this merging for the columns, will I also have to merge the data rows? Or will the table know how to handle the dimensions of the data rows based off the dimensions of the columns?

    But anyway, I will tell you what I am trying to do, maybe there is an easier way:

    I have a bunch of programs that behave in a generic way. Each validates a particular CSV file and if valid uploads the CSV file into our system. For each error in the CSV file, I display the error. I want to group all of the errors associated with a single row in the CSV file. I also want to have a checkbox associated with each group, to allow the user to remove (by checking the box) the row form their file, thus allowing them to proceed with the upload without the invalid rows.

  • actually, i just thought of another way to do this:

    I can actually fit everything in one row, i don't need multiple rows per record (though it would look better). I will try this way.

    Thanks
  • To answer your earlier question, when you set RowsToRecords, you are effectively telling the table to automate things for you. In this case, when you use CellMerge, the table will effectively copy that setting to all subsequent "record", ensuring a consistent look throughout. Thus, you only have to do the complicated setup at the beginning. From there, the table does the rest.
  • KevinFournier,

    ok, that's good. That changes my mind. I might try it then.

    thanks
  • Hi, I am trying to do what Don said. I want the third column to span two columns:


    But my code isn't working. What is wrong with the code?
    Set_Property(table, "OLE.Dimension", "2":@fm:1) Set_Property(table, "OLE.HeaderMerge[3; 2]", 2:@fm:1) Set_Property(table, "OLE.RowsToRecords", 2) Set_Property(table, "OLE.TitleList", "One":@vm:"Two":@vm:"three")
  • Shouldn't that be HeaderMerge[2; 2]? Also, if you just do CellMerge it should affect your headers automatically.
  • edited May 2019
    oh right thanks. It works! I could have sworn that I had tried that



  • hi Don,

    i also want the third field to be a multi line field. Is there anyway for me to only have to set that once and the table will know that every cell which is the third field should be multilined?
  • It should work automatically.
  • edited May 2019
    Ok thanks, actually this won't work, as I am running into the same bug that I ran into last time (https://forum.srpcs.com/discussion/817/merge-not-working#latest) .

    Anyway, I have thought of yet another way to do this using the report table, fingers crossed that I don't run into another problem.
Sign In or Register to comment.