[CLOSED] Editable ComponentColumn in a Gridpanel setting MaxValue

  1. #1

    [CLOSED] Editable ComponentColumn in a Gridpanel setting MaxValue

    Hi,
    In version 1.x of EXT.NET, I could do the following with a numberfield as an editor within a gridpanel, and it would apply the maxvalue to the numberfield in the editable column for each row:

    ((NumberField)this.gridPanel1.ColumnModel.Columns[5].Editor[0]).MaxValue = Convert.ToDouble(balance.ToString("#0.00"));
    I've now converted the code to 2.0, and use a ComponentField and NumberField for the editor. I can access the ComponentColumn/Numberfield in the in the codebehind and I can apply the maxvalue to the field, like this:

    ComponentColumn cc = ((ComponentColumn)this.gridPanel1.ColumnModel.Columns[5];
    Numberfield nf = ((NumberField)cc.Component[0]);
    nf.MaxValue = 1000;
    The code compiles fine, but I now get a javascript error telling me the control is undefined? This didn't happening in 1.x. I'm wondering what the solution is to do the same as I did in 1.x?

    Many Thanks,
    Kev
    Last edited by Daniil; Sep 25, 2012 at 6:50 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I can suggest the following solution for ComponentColumn.
    this.GridPanel1.Set("columns[0].component.maxValue", 1000);
    this.GridPanel1.GetView().Refresh();
    If there is no View for GridPanel, please set up:
    <View>
        <ext:GridView ID="GridView1" runat="server" />
    </View>
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    I can suggest the following solution for ComponentColumn.
    this.GridPanel1.Set("columns[0].component.maxValue", 1000);
    this.GridPanel1.GetView().Refresh();
    If there is no View for GridPanel, please set up:
    <View>
        <ext:GridView ID="GridView1" runat="server" />
    </View>
    This doesn't work anymore.

    Any changes of the Component should be done within a ComponentColumn's Bind listener.

Similar Threads

  1. [CLOSED] ComponentColumn
    By canbay in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 26, 2012, 7:56 PM
  2. [CLOSED] ComponentColumn
    By canbay in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 10, 2012, 5:26 PM
  3. Replies: 1
    Last Post: Apr 06, 2011, 12:32 PM
  4. GridPanel NumberField Editor MaxValue
    By vincent_van in forum 1.x Help
    Replies: 0
    Last Post: Feb 10, 2011, 7:41 AM
  5. [CLOSED] GridPanel NumberField MaxValue
    By Ben in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 17, 2009, 12:22 PM

Tags for this Thread

Posting Permissions