in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

newbie question

Last post 11-27-2007 9:32 PM by Burton. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-27-2007 12:09 PM

    • Burton
    • Not Ranked
    • Joined on 04-26-2006
    • Posts 4

    newbie question

    This is first time I am using C1List and am having some difficulty with object model, I think.
     
    I don't understand how to access the values in the columns of a selected row.
     
    For instance, if I have 2 C1List grids and I have a row selected on each grid, and I want to copy the data from one column of the selected row on grid1 to a column on the selected row of grid2 programatically, how do I do it, please?
     
    Just a code example is all I need.
     
    Thanks
    Burt
  • 11-27-2007 5:26 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 500

    Re: newbie question

    This code will "copy" data from one C1List column to another, replacing the selected index on the 2nd C1List.

    C1List2.InsertItem(C1List1.GetItemText(C1List1.SelectedIndex, 0), C1List2.SelectedIndex)
    C1List2.RemoveItem(C1List2.SelectedIndex + 1)

    Hope that helps,
    Greg L

    Filed under:
  • 11-27-2007 9:32 PM In reply to

    • Burton
    • Not Ranked
    • Joined on 04-26-2006
    • Posts 4

    Re: newbie question

    Thanks, that did help. I am surprised that there is a GetItemText method but not a corresponding SetItemText method.  However, it's not too difficult to update the underlying datatable instead.

    Thanks again

    Burt

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.