Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
122 views
Can someone help with this..
I have a a RadPanelBar that im programatically populating with RadPanelItems, and 1 CheckBoxList inside of each radpanelItem.
Below is the the code i sue to pull data from a dataset and create RadpanelItem and its checkboxlist child:
-----------------------------------------
//Loading Permission Tabs
PermissionDataSet PermissionsDS = _PermissionFactory.PermissionSelectDynamicWithTables("", "", "[dbo].[Permission].[Type],[dbo].[Permission].[Name]");
string PermissionType = "";

           //Loading DS and creating RadPanelItem/CheckboxList
            for (int x = 0; x < PermissionsDS.Permission.Rows.Count; x++) {
                PermissionDataSet.PermissionRow PermissionRow = (PermissionDataSet.PermissionRow)PermissionsDS.Permission.Rows[x];
                if(!PermissionRow.Type.Equals(PermissionType)){
                    RadPanelItem ThisRadPanelItem = new RadPanelItem();
                    ThisRadPanelItem.Value = PermissionRow.Type;
                    ThisRadPanelItem.Text = PermissionRow.Type;
                    CheckBoxList ThisCheckBoxList =  new CheckBoxList();
                    ThisCheckBoxList.RepeatColumns = 8;
                    ThisCheckBoxList.RepeatDirection = RepeatDirection.Horizontal;
                    ThisCheckBoxList.CssClass = "3column";
                    //Loading Permission Items
                    PermissionDataSet ThisPermissionsDS = _PermissionFactory.PermissionSelectDynamicWithTables("", "[dbo].[Permission].[Type] = '" + PermissionRow.Type + "'", "[dbo].[Permission].[Name]");
                    if (EditMode)
                    {
                        for (int y = 0; y < ThisPermissionsDS.Permission.Rows.Count; y++)
                        {
                            int PermissionId = int.Parse(ThisPermissionsDS.Permission.Rows[y]["Id"].ToString());
                            string PermissionName = ThisPermissionsDS.Permission.Rows[y]["Name"].ToString();
                            RolePermissionDataSet.RolePermissionRow ThisRolePermissionRow = _RolePermissionFactory.RolePermissionSelectByRoleIdAndPermissionId((int)_SelectedRole.Id, PermissionId);
                            
                            ListItem ThisListItem = new ListItem();
                            ThisListItem.Text = PermissionName;
                            ThisListItem.Value = PermissionId.ToString();
                            if (ThisRolePermissionRow != null) ThisListItem.Selected = true;
                            ThisCheckBoxList.Items.Add(ThisListItem);
                        }
                    }else{
                        ThisCheckBoxList.DataSource = ThisPermissionsDS;
                        ThisCheckBoxList.DataTextField = "Name";
                        ThisCheckBoxList.DataValueField = "Id";
                    }
                    ThisCheckBoxList.ID = "ThisCheckBoxList";
                    ThisCheckBoxList.DataBind();
                    ThisRadPanelItem.Expanded = true;
                    ThisRadPanelItem.CssClass = "RadPanelBarPageContent";

                    ThisRadPanelItem.Controls.Add(ThisCheckBoxList);
                    RadPanelBarPermissions.Items.Add(ThisRadPanelItem);

                    PermissionType = PermissionRow.Type;
                }
            }

OK the important part is how i attach the radpanelitem and checkbox to the radpanel bar as you can see bolded above, and it all works well. The page loads with all radpanelitems inserted and 1 checboxlist inside of each radpanelitem.

When i try to consume the whole radpanelbar with a loop, to check which items on the checboxlist are selected, I CANT FIND THE CHECKBOX LIST,  eventhought im able to select the radpanelitem, code below:

 ffor (int x = 0; x < RadPanelBarPermissions.Items.Count; x++)
                    {
                        //RadPanelItem ThisPanelItem = RadPanelBarPermissions.FindItemByValue("");
                        RadPanelItem ThisPanelItem = (RadPanelItem)RadPanelBarPermissions.Items[x]; THIS WORKS
                        CheckBoxList ThisCheckBoxList = (CheckBoxList)RadPanelBarPermissions.Items[x].FindControl("ThisCheckBoxList"); THIS DOES NOT WORK, Checkboxlist returns null...
.....
Youll see in the picture that the controls load normal after icreate them, but when i try to acces them, the ceckboxlist is gone!!!!
Please help!!!

Thank You.
}
Cesar
Top achievements
Rank 1
 asked on 18 Feb 2012
0 answers
45 views
I am having an interesting problem when I upgraded the .NET Framework from 2.0 to 4.0.  The problem exists in all browsers that I have tried so I don't think it is browser related.

The problem is as follows:

If I enter just the domain name it brings up the default page served up by the web server.   If I click on the panel bar it will not expand.  I've even tried opening the page with one panel expanded to see if I can click on another one to close that one and have the clicked one open.  In that case, although the one I set to open is open when the page opens, I cannot get the other panel to open when I click on it.

The panels worked fine using .NET Framework 2.0 though.  But the most interesting thing is that if I specify the default page in the browser (e.g., www.mydomain.com/Default.aspx) instead of just the domain name (www.mydomain.com) then it all works like it should (i.e., when I click on a panel it opens up fine).  Thus the problem occurs on pages that I don't specify explicitly but that the server uses by default.  My web server is IIS 6.0.

Is this a bug in the PanelBar control?

Thanks
Jay
Jay
Top achievements
Rank 1
 asked on 18 Feb 2012
1 answer
100 views

RadGrid with filters is bound to a collection of objects. When filter changes, there is an async postback during which I can determine the filters by examining FilterExpression property which has the values like this:

(iif(CatalogNumber == null, \"\", CatalogNumber).ToString().ToUpper().StartsWith(\"na\".ToUpper()))

What I want to do with this is filter the collection of object on server which the grid is bound to and looks like this:

 

 

private List<LineItem> _lineItems = new List<LineItem>

 

{

 

new LineItem { Id="4300" CatalogNumber="ab" },

 

 

new LineItem { Id="4301"CatalogNumber="naf-1"}

 

 

}

 

};

I am not sure how FilterExpression can be used in this situation and why it has these "iif" and so on.  I don't want brute force method of parsing it out and thinking that there maybe a reason why it has this format. How can I plug it in to the custom collection to filter it?

-Stan

 

Stan
Top achievements
Rank 1
 answered on 17 Feb 2012
1 answer
273 views
Hi,
 I have a grid with scrolling, static headers and column resizing enabled. I want to assign minimum and maximum width for columns while reiszing them, so that user will be restricted from resizing after that(not by cancelling event). Also as grid with static headers do not recalculate width of all columns after resizing, I want to change width of other columns in oncolumnresizing or oncolumnresized event to maintain width of masterview table as a whole.
Richard
Top achievements
Rank 1
 answered on 17 Feb 2012
4 answers
186 views
Hi ,
RadTextBox is behaving like RadEditor in terms of resizable where the users can able to see the dock like panel in the lower left corner
which is similar to RadEditor.This issue is only Mozilla Firefox . User is using Firefox 10.0.
Please find the attached image file.
.InnerTextStyle
{
font-family: Verdana, Arial, Helvetica, sans-serif;

    color: black;

    font-size:9pt;
}

                           <telerik:RadTextBox ID="txtTitle" MaxLength="1000" CssClass="InnerTextStyle" runat="server"
                                                            TextMode="MultiLine" Height="62px" Width="500px" ClientIDMode="Static">
                                                        </telerik:RadTextBox>
What should be done to disable the end user to resize in Firefox?
Vasil
Telerik team
 answered on 17 Feb 2012
2 answers
179 views
Hello,
I am posting a simplified version of my code to demonstrate the problem I am having. 
If I click on a menu item, one window opens.
Then, if I click on another menu item, TWO window open. Following clicks cause two windows to open.
I only want one window to open at a time.
If I remove ajax, it works fine.

It seems like Sys.Application.add_load(OpenWindow1) is not being rendered on the page. Not sure why.

Please help.

Thanks,
Simone


       cs:
    protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    protected void subMenu_ItemClick(object sender, RadMenuEventArgs e)
    {
        switch (e.Item.Value)
        {
            case "Window1":
                {
                    if (!ClientScript.IsStartupScriptRegistered("OpenStartupWindow1"))
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenStartupWindow1", "Sys.Application.add_load(OpenWindow1);", true);
                }
                break;
 
            case "Window2":
                {
                    if (!ClientScript.IsStartupScriptRegistered("OpenStartupWindow2"))
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenStartupWindow2", "Sys.Application.add_load(OpenWindow2);", true);
                }
                break;              
        }
    }
}


aspx:
<body>
 
    <div id="div1" runat="server">
        <script type="text/javascript">
            function OpenWindow1() {
                var oWnd = radopen("WebForm1.aspx", "wndWebForm1");
            }
            function OpenWindow2() {
                var oWnd = radopen("WebForm2.aspx", "wndWebForm2");
            }
        </script>
    </div>
 
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
 
    <telerik:RadWindowManager ID="RadWindowManagerEmails" ShowContentDuringLoad="false"
        VisibleStatusbar="false" runat="server" EnableShadow="true">
        <Windows>
            <telerik:RadWindow ID="wndWebForm1" runat="server" Behaviors="Close,Move,Resize"
                 Width="1100" Height="600" NavigateUrl="WebForm1.aspx">
            </telerik:RadWindow>
            <telerik:RadWindow ID="wndWebForm2" runat="server" Behaviors="Close,Move,Resize"
                 Width="600" Height="600"
                NavigateUrl="WebForm2.aspx">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
 
        <telerik:RadAjaxManager runat="Server" ID="RadAjaxManager1" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="subMenu">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="txt1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <div style="display: block; width: 100%; height: 30px;">
        <telerik:RadMenu ID="subMenu" runat="server" EnableViewState="false" Orientation="Horizontal"
            SkipLinkText="" CausesValidation="true" OnItemClick="subMenu_ItemClick">
            <Items>
                <telerik:RadMenuItem Text="Open Window 1" Value="Window1" />
                <telerik:RadMenuItem Text="Open Window 2" Value="Window2" />
            </Items>
        </telerik:RadMenu>
    </div>
 
    <telerik:RadTextBox ID="txt1" runat="server" Width="400px">
    </telerik:RadTextBox>
    
    </form>
</body>
Simone
Top achievements
Rank 1
 answered on 17 Feb 2012
3 answers
100 views
Hello everybody,
I am using a grid with Server side selection as the same as Q1,2011 release demo(Grid/Selecting/Sever-Side Row Selection).
But I added this column to RadGrid to  have edit mode too.

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
<ItemStyle CssClass="MyImageButton" /> 
 </telerik:GridEditCommandColumn>

 

But when I click on edit ImageButton it dose not preserve the selected row states and all checkBox return to unchecked State.Is there any way to preserve the state in edit mode?

I tried to add eventHandler in ItemCreated  like this

 

 

if (e.Item is GridDataItem) 
{
e.Item.PreRender += 
new EventHandler(RadGrid1_ItemPreRender); 
}

 

and

   
private void RadGrid1_ItemPreRender(object sender, EventArgs e) 
{
((sender 
as GridDataItem)["CheckBoxTemplateColumn"].FindControl("CheckBox1") as CheckBox).Checked = (sender as GridDataItem).Selected; 
}

 but it didnt fire at edit time.

 Sincerely yours,
Bahram.
 

 

Richard
Top achievements
Rank 1
 answered on 17 Feb 2012
1 answer
93 views
Good morning,

I have on my RadGrid a RadComboBox Control

<telerik:RadComboBox runat="server" ID="comboBoxAddress" AllowCustomText="True" DataSourceID="objDataSourceAddress" EnableLoadOnDemand="True"
    Filter="Contains" DataTextField="FirstName" EmptyMessage="Suchen nach Adressen..."
    Width="289px" MaxHeight="100px">
</telerik:RadComboBox>

On that Cotnrol i set a DataSourceID

<asp:ObjectDataSource ID="objDataSourceAddress" runat="server" TypeName="Logic.AddressBll"
    SelectMethod="Select"></asp:ObjectDataSource>

Now the ComboBox works fine with, i see all the Addresses and i can search with the "Contains" Filter. My Question is now how can i work with the selected Items. For example i want to create a new recordset on my Grid, then i have to select an Address.
But for insert my Record i have to read the ID of the Address and then make my insert statement.

Regards


Kalina
Telerik team
 answered on 17 Feb 2012
9 answers
443 views
Hello people,

I use for my Webapplication the RadEditor for wiriting notes. This notes are saved in a database.
Since it is formatted text, I need the RTF string. So far I execute ExportToRtf() and I use the onExportContent-Event. In my event handler I manage to get the rtf-string with:
 protected void OnExportContentEvent( object sender,EditorExportingArgs e ) {         
        string rtf = e.ExportOutput; 
        SaveNote( rtf ); 
        ... 
    } 

This works just fine, except one problem. A dialog pops up asking to save the RTF-File. Is there a way to suppress this dialog?

Thank you for your help.
Rumen
Telerik team
 answered on 17 Feb 2012
9 answers
205 views
Hi,

This is the scenario:
I have a panel that enclose the whole page.
The page is long enough to show the scrollbar.
When you click on a combobox and the drop down list appears, try scrolling the page with the mouse wheel.
You'll notice the drop down list floats on the page when the list should just follow the location of the combobox.

Regards,
Dexter
Kalina
Telerik team
 answered on 17 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?