Grid EditFormSettings

3 posts, 0 answers
  1. David Tabatadze
    David Tabatadze avatar
    9 posts
    Member since:
    Apr 2010

    Posted 07 May 2010 Link to this post

    I am using RadGrid in my web page (asp)

    and in EditFormSettings - FormTemplate i have two RadComboBoxes with their datasources.

    here is part of my code:

    <FormTemplate>

    <telerik:RadComboBox ID="cbCompany" runat="server" 
    Enabled='<%#(Container.DataItem is Telerik.Web.UI.GridInsertionObject)%>' >

    <telerik:RadComboBox ID="cbCompanyField" runat="server" 
    OnSelectedIndexChanged="cbCompanyField_SelectedIndexChanged" />

    <FormTemplate>

    so, cbCompany is enabled only when i'm making Add New (rad commanditem), in case of editing it's enable is false.

    plus when i'm changing cbCompanyField combo, cbCompany items mast change accordig as cbCompanyField selected value.

    (on cbCompanyField_SelectedIndexChanged i change cbCompany datasource)

    the problem is that, when i change cbCompanyField item in Add New mode, and the page is posting back, cbCompany's  enable is turning to false.

    i wonder, is there any solution for this?

  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 07 May 2010 Link to this post

    I don't know if this will make any difference, but instead of the line Enabled='<%#(Container.DataItem is Telerik.Web.UI.GridInsertionObject) %>' to change it to this: Enabled='<%# (Container is GridEditFormInsertItem) %>'. That's how the Telerik demo's determine the edit mode of the form.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Tabatadze
    David Tabatadze avatar
    9 posts
    Member since:
    Apr 2010

    Posted 07 May 2010 Link to this post

    oh, thx so much, it works!
Back to Top