Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
152 views
Hi,

I create dynamic Link Button in my grid depending on DateFields.

I have had a TemplateColumn like this
<telerik:GridTemplateColumn HeaderText="Action" UniqueName="tplColAction">
                    <ItemTemplate>
                        <asp:Panel ID="pnlActionStatut" runat="server" HorizontalAlign="left">
                        </asp:Panel>
                    </ItemTemplate>
</telerik:GridTemplateColumn>

In my code behind i do that

protected void rdGridOpportunite_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType != GridItemType.Item && e.Item.ItemType != GridItemType.AlternatingItem) return;
  
        //Get Object Entity
        OpportuniteEntity opp = e.Item.DataItem as OpportuniteEntity;
        if (opp == null) return;
  
        //Get Panel
        Control pnl = e.Item.FindControl("pnlActionStatut");
        if (!(pnl is Panel)) return;
          
        //Get All statut associate of this statut
        List<TypeStatutOpportuniteEntity> statuts = TypeManager.GetStatutAssocieOfStatut(opp.TypeStatut.IDType, Profile.InstanceID).ToList();
        if (statuts.Count == 0) return;
  
        LinkButton lbAction;
          
        //Create LinkButton for each Statut  
        statuts.ForEach(s =>
            {
                lbAction = new LinkButton();
                lbAction.Text = "--> " + s.Libelle;
                lbAction.Click += new EventHandler(lbAction_Click);
                lbAction.CommandArgument = string.Format("{0};{1}", opp.ID, s.IDType);
                lbAction.ID = string.Format("lnkBtn{0}{1}", opp.ID, s.IDType);
                pnl.Controls.Add(lbAction);
                pnl.Controls.Add(new Label() { Text = "<br />" });
            }
        );
    }

My Grid can be expan or collapse and when I Expand or collapse i Lost my control ...
Ditto When I click on LinkButton i lost control too and i can't start GridCommand and lbAction Event click

I have try to make the same code on ItemCreated but the result is the same.

How I can keep my control ??

Thank you.
PS : Sorry for my English

Pavlina
Telerik team
 answered on 03 Aug 2011
2 answers
225 views
hi,

Hello, after populated the grid with a class

<telerik:RadGrid ID="radGridListTypeRoom" runat="server" 
                            AllowPaging="false"  
                            Width="100%" 
                            AutoGenerateColumns="false" 
                            OnDetailTableDataBind="radGridListTypeRoom_DetailTableDataBind">
                            <MasterTableView DataKeyNames="hotelRoomTypeId" DataMember="MasterGrid" Name="TypeRoom" Width="100%">
                                <DetailTables>
                                    <telerik:GridTableView DataKeyNames="hotelRoomTypeId" Name="DetailPrice" Width="100%">
                                         <Columns>
                                            <telerik:GridTemplateColumn HeaderText="Username">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblName" runat="server" Text='<%# Bind("name") %>'></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                    </telerik:GridTableView></DetailTables>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="name" HeaderText="Tipo di stanza">
                                    </telerik:GridBoundColumn>    
                                    <telerik:GridBoundColumn DataField="isAvailable" HeaderText="Disponibilità">
                                    </telerik:GridBoundColumn>                                    
                                </Columns>
                            </MasterTableView>
                            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                        </telerik:RadGrid>



radGridListTypeRoom.DataSource = hotel.RoomTypes;
radGridListTypeRoom.DataBind();

when fired the event to view the detail (Hierarchy)  how can i retrieve the object class?

        protected void radGridListTypeRoom_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
 
            RoomType roomType = (RoomType)dataItem.DataItem;
 
            switch (e.DetailTableView.Name)
            {
                case "DetailPrice":
                    {
 
                        break;
                    }
            }
        }


why dataitem.dataitem is null ?

Thanks for the collaboration and sorry for bad eng.
Pavlina
Telerik team
 answered on 03 Aug 2011
4 answers
102 views
OK not sure if my title was too descriptive or not, but I am rather new to Talerik so this could just be a basic question. We are using a rad window for all our messages back to a user (process succesful, or failed, and etc.) some of our recent changes added user controls to a parent page and those need to now call the rad window that is on the aspx page of the parent page and pass the message to the user. How do we do this?

Here is current code on the parent page code behind when opening the window:
if (isSuccess)
{
message = "blah blah blah was successful, now do blah blah blah";
MessageRadWindow.NavigateUrl = "MessageAlert.aspx?message=" + encrypt.encrypt(message);
MessageRadWindow.Visible = true;
MessageRadWindow.VisibleOnPageLoad = true;
}

Now, that works well for what the message window is needed to do, however I am unsure how to call that same MessageRadWindow from the user control that is now embeded in that same page via a page.loadcontol method. I have attemtped different .GetControl methods and a couple things I found on the forums here and can neve get it to compile because it isn't finding the parent page controls for some reason. I am getting things like:
Error 281 The name 'RadAjaxManager1' does not exist in the currentcontext C:\_tfs\xxxx\xxxx\xxxx\Schedulexxxx.ascx.cs 81 14 xxxx_admin

What am I missing? Does the usercontrol need it's own ajax manager, and if so how do I get it there because I get errors stating cannot have more than on ajax manager on a page when I attempted to add one tot he user control?
Marin Bratanov
Telerik team
 answered on 03 Aug 2011
4 answers
91 views
Is it possible to change the text of the Mode Tabs?  For example, inside of the tab saying "Design" I'd like it to say "Edit".
Matt
Top achievements
Rank 1
 answered on 03 Aug 2011
4 answers
144 views
Hi,

I have a RadRotator that shows the list of images and the rotator scrolls from top to bottom. I just want to illustrate my problem with an example. I have 5 images bound to the rotator control. At any point of time, only 2 images will show up. i scroll down and select image 4. I have OnItemClick event that does some action based on the image that i select. My objective is: I would want to retain the selection of 4th image (at least from the UI perspective). What is happening is: after the postback event, selection is lost in the radrotator event and rotator resets and shows the first item. Is there a way that i can retain the same image? I tried doing partial postback using AJAX to ensure rotator control is not updated. But even this didn't help. any help on this?

<telerik:RadRotator ID="thumbRotator" runat="server" RotatorType="Buttons" WrapFrames="false"
                        FrameDuration="1" ScrollDirection="Up, Down" OnItemClick="thumbRotator_ItemClick"
                        EnableEmbeddedSkins="false" Skin="FAPortalRotator" CssClass="rotatorVertical"
                        ItemWidth="300px" ItemHeight="225px">
                        <ItemTemplate>
                            <asp:Image ID="chartImage" runat="server" AlternateText="Image" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ImageURL")%>'
                                CssClass="thumbnail" />
                        </ItemTemplate>
                        <ControlButtons LeftButtonID="img_left" RightButtonID="img_right" />
                    </telerik:RadRotator>


Regards,
Kishan G K
Kishan Gandikota
Top achievements
Rank 1
 answered on 03 Aug 2011
3 answers
100 views
I have a radgrid inside a radajaxpanel.  outside of the ajaxpanel I have an instance of a usercontrol that has two buttons: one button exports the radgrid to excel and the other exports the radgrid to a pdf doc.  I can get the code to execute and open the results of the radgrid in a new window either excel or PDF, but when I close the new window and return to the parent page, the mouse pointer is an hourglass until I either manually refresh the page, or click a different button on the page that does a postback.  How do I get the hourglass to go away and display the normal mouse pointer?
Pavlina
Telerik team
 answered on 03 Aug 2011
1 answer
99 views
Hi dear,
my javascript code dosen't work and i got stack overflow error after a timeout.
this is my javascript code for itemShowing:

 

function itemShowing_handler(sender, args)

 

{

log(sender.get_id() +

" is about to change a frame");

 

 

 

var rotator = $find("<%= RadRotator1.ClientID %>");

 

rotator.showNext(Telerik.Web.UI.RotatorScrollDirection.Right);

}

I have 2 rotator, RadRotator1 and RadRotator2. RadRotator2 has 4 items in every showing, RadRotator1 must show items of RadRotator2, one by one in the duration of itemshowing of RadRotator2. but
Marin Bratanov
Telerik team
 answered on 03 Aug 2011
3 answers
155 views
Hello,

I have a date column in my grid which shows dates in the "d" format, dd/MM/yyyy.  However, the underlying data sometimes (actually most of the time) contains dates that have a non-12 AM time component, such as 12/10/1998 8:30 am.  The user does not see the 8:30 am part, and when they try to use the column filter for date EdualTo 12/10/1998, they do not get a match, since the time component is not the perfect 12:00:00 am.  Is there any trick to get around this issue?
Dasha
Top achievements
Rank 1
 answered on 03 Aug 2011
1 answer
302 views
Hello,

I have the folowing RadSplitter control.
I need to expand the RadSlidingPane (ContentRadSlidingPane) onload, and to prevent the use from collapsing it (Exactly as http://www.telerik.com/help/aspnet-ajax/introduction.html).
<telerik:RadSplitter ID="RadSplitter1" runat="server" Width="700" Height="500">
           <telerik:RadPane ID="LeftPane" runat="server" Width="22px" Scrolling="none">
                <telerik:RadSlidingZone ID="ContentsSlidingZone" runat="server" Width="22px">
                    <telerik:RadSlidingPane ID="ContentRadSlidingPane" Title="Pane1" runat="server"  Width="150px">
                        Contents
                    </telerik:RadSlidingPane>
                </telerik:RadSlidingZone>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="Radsplitbar1" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="MiddlePane1" runat="server" Scrolling="None">
                <telerik:RadSplitter ID="Radsplitter2" runat="server" Orientation="Horizontal" VisibleDuringInit="false">
                    <telerik:RadPane ID="Radpane2" runat="server">
                        <div style="padding: 5px">
                            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
         
                            </asp:ContentPlaceHolder>
                        </div>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
        </telerik:RadSplitter>

Please, I need you help,
It is appreciated to send me the modified code.

Regards,
Bader
Dobromir
Telerik team
 answered on 03 Aug 2011
1 answer
70 views
Hi All,
Please have a look on the image attached.

In That I have used rad grid with grouping option.
My requirement is like I need to group
-> group1
    ->groupmember1(now need to group based on groupmember1 )
    ->groupmember2(now need to group based on groupmember2 )
        -mem1
        -mem2
    ->groupmember3
->group2
 
I mean first i want to group based on group1 and inside group1
I need to group based on each member of group(groupmember1) as shown above.
In this i need to implement filteration , sorting , editing

Please let me if any way to achieve this....
Vasil
Telerik team
 answered on 03 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?