RadWindow Customize

4 posts, 1 answers
  1. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 06 Dec 2011 Link to this post

    Good Morning!
    I have the following scenario!...

    I have a Security Level Grid with delete Button.
    Delete Button have 2 ways:
    1- If Security level hasn't users associated --> Show normal Windows ("remove this security level? Yes/No")
    2- If Security level has users associated --> i need show other with with ComboBox (To assign these users to another security Level)

    I dont Kwon how do Item 2.

    Can you Help me¿?

  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Dec 2011 Link to this post

    Hello,

    Try attaching click event of button and open the window based on your condition. Here is the sample code.
    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
     <Windows>
      <telerik:RadWindow ID="Window1" runat="server">
      </telerik:RadWindow>
      <telerik:RadWindow ID="RadWindow2" runat="server">
       <ContentTemplate>
        <telerik:RadComboBox ID="RadComboBox1" runat="server">
          <Items>
           <telerik:RadComboBoxItem runat="server" Text="A1" />
           <telerik:RadComboBoxItem runat="server" Text="A2" />
           <telerik:RadComboBoxItem runat="server" Text="A3" />
           <telerik:RadComboBoxItem runat="server" Text="A4" />
          </Items>
         </telerik:RadComboBox>
       </ContentTemplate>
      </telerik:RadWindow>
     </Windows>
    </telerik:RadWindowManager>

    JS:
    function test()
    {
     var i = 0;
     if (i == 1) // give your condition here
     {
       var wd = window.radopen(null, "RadWindow1");
     }
     else
      {
      var wd = window.radopen(null, "RadWindow2");
      }
     }
    }

    Thanks,
    Princy.
  3. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 06 Dec 2011 Link to this post

    Sorry I need code my condiction in code behind (server sside)
  4. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 06 Dec 2011 Link to this post

    I found the solution!
    I dont how if the correct way : but is working

    protected void UserGrid_DeleteCommand(object sender, GridCommandEventArgs e)
            {
                var securityLevelId = ((GridDataItem)e.Item).GetDataKeyValue("Id").ToString();

                if (_organization.SecurityLevelHasUser(Convert.ToInt16(securityLevelId)))
                {
                    RadAjaxManager.GetCurrent(this).ResponseScripts.Add(String.Format("return ShowDelete('{0}','{1}');",
                                                                                      e.Item.OwnerTableView.DataKeyValues[
                                                                                          e.Item.ItemIndex]["Id"],
                                                                                      e.Item.ItemIndex));
                    
                  

                }else{
                  RadWindowManager1.RadConfirm("test", "confirmCallBackFn", 330, 100, null, "test");
              }
    ShowDelete --> open a radWindow
Back to Top