[CLOSED] Geting combobox value and/or text from code behind

  1. #1

    [CLOSED] Geting combobox value and/or text from code behind

    Hello

    On my grid, I have a row editor. In this editor I have 3 fields that have combobox editor.

    I have to check in code behind that a year-month value have not been already added to my data.

    On the select event I called a function that do the check.

    I begin to get my editor like that:

           
            ColYear = grd.ColumnModel.Columns(8)
            ColMonth = grd.ColumnModel.Columns(9)
    
            cboYear = ColYear.Editor(0)
            cboMonth = ColMonth.Editor(0)
    (I try to change
    ColYear.Editor(0)
    by
    ColYear.Editor.Primary
    but it is the same.)

    after that, I do something like that :

    INT_Year = cboYear.SelectedItem.Text
    I get an error message :

    Object referenced is nothing.
    means my cboYear combo is nothing.

    So how handle that?
    Last edited by Daniil; Apr 27, 2012 at 8:59 AM. Reason: [CLOSED]
  2. #2
    Hi,

    A field of Editor is rendered outside the form. So, its value is not submitted automatically and you need to pass a selected value manually via ExtraParams.
  3. #3
    OK it is the solution I have found, in the Extraparams I pass a getValue() of the 3 combobox needed, meanwhile, there is no way to get the value or the text of a selected element of a combobx in code behind.

    As we can set a value with combo.setValue() function, I though we can getthe value in the same way with something like getValue() bu function seems to be not implemented.
  4. #4
    Quote Originally Posted by feanor91 View Post
    As we can set a value with combo.setValue() function, I though we can getthe value in the same way with something like getValue() bu function seems to be not implemented.
    Do you mean server side?

    Well, the server side SetValue method just generates a respective JavaScript which will be sent in a response to be executed on client side.

    If a ComboBox selected value is not submitted from client side, there is no way to get it on server side.
  5. #5
    Well, of course, from this point of view it must be hard.

    so, OK, I get it, and will work with extraparams.

    Thanks.

Similar Threads

  1. Replies: 11
    Last Post: Feb 13, 2012, 9:17 AM
  2. [CLOSED] Geting rid of the unlicensed message
    By Bert76 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 22, 2011, 5:04 PM
  3. Change the Text value from code behind
    By marcelodecon in forum 1.x Help
    Replies: 2
    Last Post: Aug 05, 2010, 12:10 PM
  4. Replies: 25
    Last Post: Jun 24, 2010, 9:36 PM
  5. Replies: 10
    Last Post: Apr 05, 2010, 1:42 AM

Posting Permissions