Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
263 views
Hi all,

Apologies if this is a question answered elsewhere or if I've missed something simple.

I've got a treeview in which I build the nodes dynamically based on a datasource - specifically I'm manually creating new RadTreeNodes and inserting them because I want different behaviours based on each, but that's probably not directly relevant. At the time of creating each node I assign it to a predefined (in the .aspx) RadContextMenu, like this:

RadTreeNode contactNode = new RadTreeNode();  
if (contact == currentCustomer.ContactAccounts)  
   contactNode.ImageUrl = "~/images/icons/16/user-business.png";  
else 
   contactNode.ImageUrl = "~/images/icons/16/user-worker.png";  
contactNode.Text = contact.Name;  
 
if (contact.Email.Length > 0 && contact.Fax.Length > 0)  
{  
   contactNode.ContextMenuID = "contactContextMenuEmailAndFax";  
}  
else if (contact.Email.Length > 0)  
{  
   contactNode.ContextMenuID = "contactContextMenuEmailOnly";  
}  
... etc etc etc 

There are two things I'd like to do and haven't found a means of doing:

1) rather than define 4 multiple menus including email, fax, email and fax and neither, it'd be nice to be able to iterate the collection of menuitems and simply disable the ones that don't matter

2) I'd like to set the NavigateUrl property of the "Email contact" menu item to a mailto: link at render time


Is there a way to do this?

Cheers,

Kev
Nikolay Tsenkov
Telerik team
 answered on 23 Dec 2010
1 answer
66 views
Hello,

I am using a Grid with a custom filter column as described in the demo http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filteringtemplatecolumns/defaultcs.aspx 

The problem I have is that when I turn off the viewstate for the grid the event below does not fire in the event chain.
private void rcBox_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
     {
         ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
     }


        private void rcBox_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
        }
   private void rcBox_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
        }
If I turn on view state then it works fine. I have tried setting the selectedvalue in the "protected override void SetupFilterControls(TableCell cell)" method as follows, but all that does is maintain the selectedvalue during postback and does not cause the  rcBox_SelectedIndexChangedevent to fire. You can see from the code below I tried to fire the Filter command but it is too early and causes other problems.

var formvalue = HttpContext.Current.Request.Form[rcBox.UniqueID];
           if (!string.IsNullOrEmpty(formvalue))
           {
               rcBox.SelectedValue = formvalue;
               //((GridFilteringItem)(rcBox.Parent.Parent)).FireCommandEvent("Filter", new Pair());
           }


Is this a bug in the grid, my only solution is to use viewstate but this is a large gird.

I have also notcied that if the viewstate is switched off you can not change page with the page number buttons and can only use the left and right page buttons.
Iana Tsolova
Telerik team
 answered on 23 Dec 2010
4 answers
174 views
I'm wondering how to use the new TouchScrollExtender - could someone post an example- code?

Thank you!
Kamen Bundev
Telerik team
 answered on 23 Dec 2010
1 answer
71 views
There are two problems I hope you can help with:

1. how to remove the unsightly gap between image and text on mouseOver
2. how to remove the border of the rad menu

The attached .png shows both.

Thanks in advance,
Nachi
Kamen Bundev
Telerik team
 answered on 23 Dec 2010
3 answers
79 views
Inside my ItemCommand event I am handling a grid edit, and when I set the e.Canceled flag to true, the CaptionDataItem does not display (it shows EditItem - {0}.

Any ideas?

Thanks!
Marin
Telerik team
 answered on 23 Dec 2010
5 answers
1.1K+ views
I have an empty RadPanelBar on my webpage. When I say empty, I mean that just the <telerik:RadPanelBar></telerik:RadPanelBar> definition exists with no RadPanelItems in it.

On page load, I check to see if the page has been posted back, and if not, I create and add a dynamic number of RadPanelItems to the RadPanelBar. Each of these RadPanelItems has a control in it (for testing I'm using a textbox, but eventually it will be a RadGrid).

I run my page for the first time and up comes my RadPanelBar with the right number of RadPanelItems, and in each one is a textbox. I enter a value into a textbox and click a submit button and the page postsback to itself.

Now when my page loads, a strange thing happens...
The event that loads the RadPanelItems does not fire but the RadPanelBar still has the dynamically added RadPanelItems, but these items have no controls in them so now my textboxes have disappeared and I have no access to the values that were entered into them.

If I skip the check and load the RadPanelItems everytime the page is hit, the I get more strangeness...

The original RadPanelItems that were created when the page was first loaded are still there, along with newly created RadPanelItems after postback, the new RadPanelItems have the empty textboxes in them, but the existing RadPanelItems again have no textboxes and again I've lost my values.

How on earth do I get around this? I need to dynamically add RadPanelItems and controls to a RadPanelBar, but then need access to these and the controls in them so I can access their values after postback!
Josh
Top achievements
Rank 1
 answered on 23 Dec 2010
1 answer
54 views
Hello,

 In my pagge one grid is thre when i am adding record page post back , some time grid display is not proper .  please find the attachment images
skin is simple
1. Display problem
2. Proper display .. want shown grid all time same like this


grid aspx code

<telerik:RadGrid ID="grdBayInfo" runat="server" AutoGenerateColumns="false" AllowPaging="true"
                                            AllowSorting="true" BorderStyle="Solid" Skin="Simple" ItemStyle-BackColor="#FFFFFF"
                                       PagerStyle-AlwaysVisible ="true" PageSize="4" OnPageIndexChanged ="grdBayInfo_PageIndexChanged" OnPageSizeChanged="grdBayInfo_PageSizeChanged"
                                            OnItemCommand="grdBayInfo_ItemCommand" ShowHeader="true" Width="600px">
                                            <PagerStyle Mode="NumericPages"  />
                                            <MasterTableView EditMode="InPlace" DataKeyNames="FacilityId,BayId,BayName,PricePerHour"
                                                CommandItemDisplay="None" Width="600px">
                                                <Columns>
                                                    <telerik:GridTemplateColumn HeaderText="FacilityId" DataField="FacilityId" Visible="false"
                                                        UniqueName="FacilityId">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblFacilityId" Text='<%# Eval("FacilityId")%>' runat="server"></asp:Label>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="BayId" DataField="BayId" UniqueName="BayId"
                                                        Visible="false">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblBayId" Text='<%# Eval("BayId")%>' runat="server"></asp:Label>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn UniqueName="BayName" HeaderText="BayName">
                                                        <HeaderStyle ForeColor="#326DA0" BackColor="#EEEEEE" BorderStyle="Solid" BorderColor="#326DA0" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblBayName" Text='<%# Eval("BayName")%>' runat="server"></asp:Label>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                                                        EditImageUrl="Images/edit.gif" HeaderText="Edit" AutoPostBackOnFilter="true"
                                                        HeaderStyle-Width="10%">
                                                        <HeaderStyle ForeColor="#326DA0" BackColor="#EEEEEE" BorderStyle="Solid" BorderColor="#326DA0" />
                                                    </telerik:GridEditCommandColumn>
                                                    <telerik:GridButtonColumn ConfirmText="Delete this Bay?" ConfirmDialogType="RadWindow"
                                                        HeaderText="Delete" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete"
                                                        Text="Delete" HeaderStyle-Width="10%" UniqueName="DeleteColumn" ImageUrl="Images/action_delete.gif">
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        <HeaderStyle ForeColor="#326DA0" BackColor="#EEEEEE" BorderStyle="Solid" BorderColor="#326DA0" />
                                                    </telerik:GridButtonColumn>
                                                    <telerik:GridTemplateColumn UniqueName="PricePerHour" HeaderStyle-Width="30%" HeaderText="PricePerHour">
                                                        <HeaderStyle ForeColor="#326DA0" BackColor="#EEEEEE" BorderStyle="Solid" BorderColor="#326DA0" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label1" Text="$" runat="server"></asp:Label>
                                                            <asp:Label ID="lblPricePerHour" Text='<%# Eval("PricePerHour")%>' runat="server"></asp:Label>
                                                            <asp:Label ID="Label2" Text="/Hour" runat="server"></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:Label ID="Label1" Text="$" runat="server"></asp:Label>
                                                            <asp:TextBox Width="50%" ID="txtPricePerHour" Text='<%# Eval("PricePerHour")%>' runat="server"></asp:TextBox>
                                                            <asp:Label ID="Label2" Text="/Hour" runat="server"></asp:Label>
                                                        </EditItemTemplate>
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </telerik:GridTemplateColumn>
                                                </Columns>
                                            </MasterTableView>
                                            <ClientSettings>
                                                <Scrolling AllowScroll="True" ScrollHeight="100px" UseStaticHeaders="True" SaveScrollPosition="True">
                                                </Scrolling>
                                            </ClientSettings>
                                        </telerik:RadGrid>

thanks


Pavlina
Telerik team
 answered on 23 Dec 2010
1 answer
98 views
Is it possible to prevent the client side animation of the RadPanelBar?
I use it as a menu, the PanelBar start to expand when clicked before it goes to the URL of the link.

Thanks,
Marc
Cori
Top achievements
Rank 2
 answered on 23 Dec 2010
14 answers
329 views

Hi

I have a large form (Approx 120 kb) in which i use a combination of Peter Blum's VAM controls, the ordinary aspx controls and telerik controls. In the page I have just upgraded the solution from Promethious 2007-Q3 to the newest version.

I tried to insert the Form Decorator to give the site a more complete look, and therefore I inserted the following line:
    <telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" Skin="Office2007" runat="server" />

When I open the page, the site looks fine an the Form Decorator works perfectly, but when I try to exit the page, i get the error:

Line: 6
Error: '_events' is null or not an object

If I remove the formdecorator I won't get the above error.

Because the page is very large, it makes it difficult to isolate the error. So any help or clues as to why this might happen would be greatly appreciated.

Thanks in advance
Dennis Cassøe

Elias
Top achievements
Rank 2
 answered on 23 Dec 2010
2 answers
270 views
Hello,

I know how to access the controls inside the RadGrid for Grid's Itemdatabound and also the Grid's ItemCommand

I have a ASP repeater in the editformsettings and I am using EditMode="EditForms" in the MasterTableView.

In my edit form template there is a label above the repeater which I need to access and change its text when:
a button inside the Repeater is clicked. So I have the ItemCommand Subroutine in the code behind page which is able to access all the elements of the repeater with no problem but I want to also change the text of the label above the repeater which is a RadGridEditItem after the button is clicked in the repeater.

Can you show me how to?

Thanks,
Sanjay
Sanjay
Top achievements
Rank 1
 answered on 23 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?