Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
74 views

Hi,

We are creating an application that allows users to enter and view news stories. In the news listing screen, we are using a radgrid to display the news stories. Each row shows the news headline and the first two lines of the body of the story. We would like to allow users to click on an icon beside a row to dynamically expand and contract the body of the new story so that the first two lines expands to the full story and then collapses back to the first two lines.

On the initial load of the news listing, we will not load the full body of each story, just the first two lines. So, the expand function will have to retrieve the body. We would prefer to use a Webservice call to retrieve the body of the story.

When the body of the content is expanded, we would like to show some minor animation effects to make the presentation of the story a little more interesting - e.g. have the panel expand downwards a little slower.

What is the best way to accomplish this? We have been using the RadXmlHttpPanel to call the Webservice to get the body of the story, but this control does not provide any effects in displaying the content.

So, in summary, we would like to do the following:

1. Show a list of news stories with the first two lines of the body displayed.
2. The user clicks a button (or "More..." link) to expand the body.
3. A Web Service is called to full body of the story.
4. Once retrieved, the body of the story slowly opens up
5. The user clicks a button (or "Less...") link to contract the body of the story

Any thoughts?
Pero
Telerik team
 answered on 30 Jun 2011
2 answers
268 views
I have created a page with a Master / Detail pair of grids with the help of the excellent tutorial here on the Telerik site.

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx

I got this working fine from the start. I have the top row in the grid highlighting when the page loads and the details grid responds with the correct data for that grid. Selecting another row on the master works the same way. The details grid updates and joy and happiness abound. :)

The top grid has a simple SqlDataSource that looks like this.

<asp:SqlDataSource ID="dsLocations" runat="server" ConnectionString="<%$ ConnectionStrings:Database_DB1 %>"
        SelectCommand = "select * from GetLocations WHERE loc_User_ID = 44"
        ProviderName="System.Data.SqlClient" >
</asp:SqlDataSource>

As you can see I am hardcoding the userID. This is my test of the system and it works.

It is when I try to set this dynamically the problems start.

First I deleted the SelectCommand parameter from the SqlDataSource above.

<asp:SqlDataSource ID="dsLocations" runat="server" ConnectionString="<%$ ConnectionStrings:Database_DB1 %>"
        ProviderName="System.Data.SqlClient" >
</asp:SqlDataSource>

Then in the Page_PreRender  of the code behind I do this. .

protected void Page_PreRender(object sender, EventArgs e)
{
    dsLocations.SelectCommand = "select * from GetLocations WHERE loc_User_ID = " + user.User_ID.ToString();
 
    if (rgLocations.SelectedIndexes.Count == 0)
    {
        rgLocations.SelectedIndexes.Add(0);
        rgActivities.Rebind();
    }
}

This works in as much as the correct Locations for that UserID are returned.

However there are 3 problems that appear
  • the first row of the grid is no longer longer highlighted ie: rgLocations.SelectedIndexes.Add(0); // fail
  • the details grid is no longer showing the details for the top row on page load id: rgActivities.Rebind(); // fail
  • finally the details grid no longer updates when you select a row from the master table.

I did not bore you with pasting my grids here. Suffice to say they work, as long as I hard code the SelectCommand in the page.

Perhaps Page_PreRender is not the correct place to set the SelectCommand on the data source?

Could someone please shed some light on what is causing this behavior?






Brad
Top achievements
Rank 1
 answered on 29 Jun 2011
2 answers
91 views
http://www.telerik.com/community/forums/aspnet-ajax/grid/setting-the-scroll-height-in-clientside.aspx

broken link inside above thread
http://www.telerik.com/help/aspnet-ajax/grdchangescrollheightatruntime.html
Dan Lehmann
Top achievements
Rank 1
 answered on 29 Jun 2011
1 answer
110 views
Hi,

When I quickly refreshes my webpage, with a set of raddocks that each have a RadXmlHttpPanel with a method to call a webservice to get the content, I get an error foreach RadXmlHttpPanel: 

Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'Telerik.Web.UI.RadXmlHttpPanelEventArgs'
cannot be converted to type 'Sys.CancelEventArgs'.
Parameter name: instance

It looks like it is caused by the OnClientResponseError method.
Is this a known issue or can someone explain me why it happens or what I can do to avoid it ?
Pero
Telerik team
 answered on 29 Jun 2011
3 answers
256 views
Apologies for my English
Here is the code for my  basic RibbonBar

<telerik:RadRibbonBar ID="RadRibbonBar1" runat="server" Width="854px"
        style="max-width: 854px;" Skin="Hay"
        onbuttonclick="RadRibbonBar1_ButtonClick" SelectedTabIndex="0">
    <telerik:RibbonBarTab Text="Insert">
    <telerik:RibbonBarGroup Text="Insert" >
   
    <Items>
    <telerik:RibbonBarSplitButton Size="Large" Text="New Item" ImageUrlLarge="Images/new_item_images.jpg" >
    <Buttons>
    <telerik:RibbonBarButton Text="Add New Catalogue" ImageUrl="" />
    <telerik:RibbonBarButton Text="Add New Catalogue Structure" ImageUrlLarge="" />
    </Buttons>
    </telerik:RibbonBarSplitButton>
    </Items>
    </telerik:RibbonBarGroup>
    </telerik:RibbonBarTab>
    </telerik:RadRibbonBar>

Help me with some a basic function if i click on one of the Ribbon buttons example "Add New Catalogue" change text on a textbox
Herman
Top achievements
Rank 1
 answered on 29 Jun 2011
5 answers
343 views
HI,
       I have a Rad editor and a Rad rotator on a page. Whenever anybody uploads an image using image manager and closes it, I want to refresh the rad rotator to show the newly uploaded images. The images for a each users are saved in user specific folder.i.e. viewpath,uploadpath is set to this folder. How can I do this?
Slav
Telerik team
 answered on 29 Jun 2011
2 answers
82 views

I need help with following in radTabStrip:

1. I am using Office2007 skin for tabstrip. The child tab does not inherit the skin property, I saw some forum posts which said child tab is supposed to show as a link instead of the same appearance as parent tab. so I tried to make a custom CSS and use it, but it did not work.
    Can you please give an example of Custom CSS of Office2007 to show up for child tab?
   
2. When using Tabstrip as a wizard, when I have a child tab then how do I proceed:
I use this code on the click of the next button:

RadTabStrip1.SelectedIndex = RadTabStrip1.SelectedIndex + 1;
RadTabStrip1.SelectedTab.Enabled = true; 
RadMultiPage1.SelectedIndex = RadMultiPage1.SelectedIndex + 1;

 

My fourth tab has 4 child tabs and I want to go from 41 to 42 to 43 to 44 and then to the 5th tab, what will be the selected index in this scenario?

Thanks in advance.

kachy
Top achievements
Rank 1
 answered on 29 Jun 2011
5 answers
158 views
I am creating multiple grids in my page's code-behind and was hoping to be able to export them all at once.  However, I cannot find any way to add these grids to a 'wrapper' grid's MasterTableView.Items collection as would be accomplished in the aspx like:


<telerik:RadGrid ID="wrapper" ... >
  <MasterTableView>
    <ItemTemplate>
      <telerik:RadGrid ID="grid1" ... />
      <telerik:RadGrid ID="grid2" ... />
    </ItemTemplate>
  </MasterTableView>
</telerik:RadGrid>


Is there any way to accomplish what I am after?

Thanks!
Daniel
Telerik team
 answered on 29 Jun 2011
1 answer
107 views
Hi,

I have user control with Div tag, I am adding all colors to that div tag. In another user control, I have Rad Tree View, in OnLoad event I am adding this user control dynamically to the Rad TreeView Context menu. Basically my intention is to change the Color of Rad Tree Node. In the usercontrol where div tag exists, I am writing the JQuery for item click. From this if i write click on Rad Tree Node, "Color" option will come and if i mouse hover to that particular option, i can view all colors so that i can change the color. So if i click on particular color, the div item click event is not firing. Suppose if put this in usercontrol, in .ascx page(not in context menu option), it's working fine. But if i add this dynamically to the Context menu, it's not firing.

Please help me on this.

Thanks in Advance,
Hari.
Plamen
Telerik team
 answered on 29 Jun 2011
1 answer
105 views
Followed is my code used to test recurrence exception functionality. I could never get it to work. The grid shows the appointment occurrences correctly. Hello World recurs exactly 4 time starting from today. However the first recurrence exception doesn't work. I wonder if you guys can provide us a simple code how to create an exception for occurrences.

List<Appointment> lstAppt = new List<Appointment>();
            Appointment objAppt;
            objAppt = new Appointment();
            objAppt.Start = DateTime.Now;
            objAppt.End = DateTime.Now.AddHours(1);
            objAppt.Description = "Hello World";
            objAppt.ID = 1;
            objAppt.RecurrenceParentID = 1;
             
            RecurrenceRange objRange = new RecurrenceRange();
            objRange.Start = DateTime.Now;
            objRange.RecursUntil = DateTime.Now.AddDays(4);//add 4 reccurence for today
 
 
            DailyRecurrenceRule objDailyRecurrenceRule = new DailyRecurrenceRule(RecurrenceDay.EveryDay, objRange);
            objDailyRecurrenceRule.Exceptions.Add(DateTime.Now);//add 1  exception for the first recurrence
 
 
 
 
            objAppt.RecurrenceRule = objDailyRecurrenceRule.ToString();
 
 
            lstAppt.Add(objAppt);
 
 
            objAppt = new Appointment();
            objAppt.Start = DateTime.Now.AddHours(3);
            objAppt.End = DateTime.Now.AddHours(4);
            objAppt.Description = "Good Bye";
            objAppt.ID = 2;
            objAppt.RecurrenceParentID = 2;
            lstAppt.Add(objAppt);
 
 
            RadScheduler1.DataSource = lstAppt;
            RadScheduler1.DataBind();
Plamen
Telerik team
 answered on 29 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?