Announcement

Collapse
No announcement yet.

Grid

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grid

    Hello,
    I have a grid with 31 rows and 4 columns.
    I would like that if several columns in the same row the same is entered, which is given me a message.
    can someone help me ?

    example : if Row 1 Column 1 = Row 1 Column 2 or Column 3 or Column 4 : Message
    if Row 1 Column 2 = Row 1 Column 3 or Column 4 : Message
    if Row 1 Column 3 = Row 1 Column 4 : Message

    if Row 1 Column 2 = Row 1 Column 3 or Column 4 : Message
    etc...

    Sorry for my very bad English.. maybe someone can speak German

    Thank

  • #2
    good work

    Comment


    • #3
      This Forum ist good if nobody need help

      Comment


      • #4
        Hi mtrx,

        If i understand you right, you looking to get an message if the same text is entered into two column on the same row, if so here is some code that can help.
        on the grid object enter this code below into the "On Cell Changed" tab. I hope this helps.

        -- Get a count of the Columns
        nCol = Grid.GetColumnCount("Grid1");

        -- A for loop that gets the text from each cell for testing
        min = 0; -- The number to start at
        max = nCol-1; -- The number to stop at
        for colcount = min, max do

        -- Get the cell text that is going to be tested
        vCellText = Grid.GetCellText("Grid1", e_Row, colcount);

        -- If the Cell text is empty then dont run the test loop
        if String.Length(vCellText) > 0 then

        -- A for loop testing the other cells for the same text
        tmin = 0; -- The number to start at
        tmax = nCol-1; -- The number to stop at
        for testcount = tmin, tmax do

        --do a test to make sure that it does not count the same cell as its testing
        if colcount ~= testcount then

        -- Now test the cells
        if vCellText == Grid.GetCellText("Grid1", e_Row, testcount) then
        Dialog.Message("Notice", "Found same text in Cell: "..colcount.." and Cell: "..testcount, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
        Application.ExitScript();
        end
        end
        end
        end
        end

        Comment


        • #5
          @SupperBin,


          Thank for your Help...

          Many Thank

          Comment

          Working...
          X