[CLOSED] PropertyGrid Values

  1. #1

    [CLOSED] PropertyGrid Values

    Hi there,

    I have been playing with the PropertyGrid control and I wondered if I could perhaps use a dropdownlist or something for the selection method of a row as I want more than true or false...

    I tried a combobox in the editor tags, but received some javascript errors...

    Also, am I able to group the options in the property grid as I see there is a GroupingView option?

    Thanks
  2. #2

    RE: [CLOSED] PropertyGrid Values

    Hi,

    This is code shows how use Combo in PropertyGrid

                    <ext:PropertyGridParameter Name="version" Value="0.01" >
                        <Editor>
                            <ext:ComboBox runat="server" TriggerAction="All" Mode="Local">
                                <Items>
                                    <ext:ListItem Text="0.01" />
                                    <ext:ListItem Text="0.02" />
                                    <ext:ListItem Text="0.03" />
                                    <ext:ListItem Text="0.04" />
                                </Items>
                            </ext:ComboBox>
                        </Editor>
                    </ext:PropertyGridParameter>
    The required parameter TriggerAction="All" Mode="Local" if you use inner items. We will investigate it and add code which to add these parameters if they are absent

  3. #3

    RE: [CLOSED] PropertyGrid Values

    Hi there,

    Thanks for your reply it works fine although I am unable get the selected value of the combobox?

    Here is my property grid
    <ext:PropertyGrid ID="ApplicationPropertyGrid" Border="false" runat="server" AutoWidth="true" AutoHeight="true">
    <Source>
        <ext:PropertyGridParameter Name="Create Application" Value="true" Mode="Raw" />
        <ext:PropertyGridParameter Name="Application Pool" Value="true" Mode="Raw" />
        <ext:PropertyGridParameter Name="Permissions" Value="None" >    
            <Editor>
                <ext:ComboBox runat="server" TriggerAction="All" Mode="Local">
                    <Items>
                        <ext:ListItem Text="None" />
                        <ext:ListItem Text="Scripts only" />
                        <ext:ListItem Text="Scripts and executables" />
                    </Items>
                </ext:ComboBox> 
            </Editor> 
        </ext:PropertyGridParameter>
    </Source>
    <View>
        <ext:GridView ID="GridView2" ForceFit="true" runat="server" />
    </View>
    </ext:PropertyGrid>
    and to reference the combo:
    string permissions = ApplicationPropertyGrid.Source[2].Value.ToString();
    It always gives me the value of "None", which is the default value. If I check the value of the dropdown it is always "";
  4. #4

    RE: [CLOSED] PropertyGrid Values

    Hi,

    I can't reproduce the problem. Can you post full code of the example which reproduces the problem?

  5. #5

    RE: [CLOSED] PropertyGrid Values



    I have just created a new project to simplify matters, but it seems the problem is when I drop the contents into a window...??


    ASPX
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager2" runat="server"/>
    
    <ext:Window ID="NewWebSiteWindow" runat="server" Collapsible="false"
    Title="Create New Weibsite" Width="500" Height="300" BodyStyle="background:#fff;" Icon="databaseadd" Closable="false" Modal="true" Resizable="false" AutoScroll="true">
    <Content>
    <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Height="300">
    <Tabs>
    <ext:Tab ID="Tab1" runat="server" Title="Tab 1">
    <Content>
    <ext:PropertyGrid ID="ApplicationPropertyGrid" Border="false" runat="server" AutoWidth="true" AutoHeight="true">
    <Source>
    <ext:PropertyGridParameter Name="Create Application" Value="true" Mode="Raw" />
    <ext:PropertyGridParameter Name="Application Pool" Value="true" Mode="Raw" />
    <ext:PropertyGridParameter Name="Permissions" Value="None" >
    <Editor>
    <ext:ComboBox ID="ComboBox1" runat="server" TriggerAction="All" Mode="Local">
    <Items>
    <ext:ListItem Text="None" />
    <ext:ListItem Text="Scripts only" />
    <ext:ListItem Text="Scripts and executables" />
    </Items>
    </ext:ComboBox> 
    </Editor> 
    </ext:PropertyGridParameter>
    </Source>
    <View>
    <ext:GridView ID="GridView2" ForceFit="true" runat="server" />
    </View>
    </ext:PropertyGrid>
    </Content>
    </ext:Tab>
    <ext:Tab ID="Tab2" runat="server" Title="Tab 2">
    <Content>
    </Content>
    </ext:Tab>
    <ext:Tab ID="Tab3" runat="server" Title="Tab 3">
    <Content>
    </Content>
    </ext:Tab>
    </Tabs>
    </ext:TabPanel>
    </Content>
    <Buttons>
    <ext:Button ID="Button1" runat="server" Text="Submit" Icon="Accept" onclick="Button1_Click">
    <AjaxEvents>
    <Click OnEvent="Button1_Click">
    <EventMask ShowMask="true" MinDelay="500" Msg="Creating website, please wait..." />
    </Click>
    </AjaxEvents>
    </ext:Button>
    </Buttons>
    </ext:Window>
    
    
    </form>
    </body>
    </html>
    CodeBehind
    protected void Button1_Click(object sender, EventArgs e)
    {
    string permissions = ApplicationPropertyGrid.Source[2].ValueToString();
    }
  6. #6

    RE: [CLOSED] PropertyGrid Values

    Please ensure that editing ended before pressing on Submit button. I can reproduce your problem only when click on button but combobox was still active. I can suggest next solution (in Before handler stop editing)

                    <ext:Button ID="Button1" runat="server" Text="Submit" Icon="Accept" &#111;nclick="Button1_Click">
                        <AjaxEvents>
                            <Click OnEvent="Button1_Click" Before="#{ApplicationPropertyGrid}.stopEditing(false);">
                                <EventMask ShowMask="true" MinDelay="500" Msg="Creating website, please wait..." />
                            </Click>
                        </AjaxEvents>
                    </ext:Button>
    Please let me know if it doesn't work for you

  7. #7

    RE: [CLOSED] PropertyGrid Values



    Hi Vladsch,

    Thanks for that, it works great!

Similar Threads

  1. [CLOSED] PropertyGrid in Menu
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 04, 2012, 12:21 PM
  2. Propertygrid values
    By ljankowski in forum 1.x Help
    Replies: 6
    Last Post: Feb 21, 2012, 11:02 AM
  3. [CLOSED] Clear PropertyGrid
    By Marcelo in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 02, 2011, 11:55 PM
  4. Replies: 2
    Last Post: Apr 01, 2010, 2:20 PM
  5. [CLOSED] PropertyGrid
    By Bernard Jourdain in forum 1.x Help
    Replies: 2
    Last Post: Oct 06, 2008, 1:58 PM

Posting Permissions