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

I'm trying to bind controls in my webApplication to a ViewModel class.
The binding itself works fine, but i got a problem, resolving the correct objects.

I bound a RadGrid to an ObjectDataSource, refering my class "PersonsViewModel"
The select-method is
        public List<Person> GetPersons()
        {
            return DataProvider.GetPeople();
        }

Now I'd like to resolve the selectedItem for example:

        var items = RadGrid1.SelectedItems;
        Person p = items[0].DataItem as Person;

My problem is, that items[0].DataItem is always null.
I don't get why, because the item is databound.



Any help would be apprechiated.
Thanks,

Thomas
Iana Tsolova
Telerik team
 answered on 30 Jun 2011
1 answer
75 views
I am using a LoadOnDemand Combo Box because the amount of data can sometimes be in the 10s of thousands.  I have enabled virtualscrolling and ShowMoreResults.  My question is that when loading data in portions of 100 - when it has to make an ajax call back to the server to get more data - is there a way to show an animated image in the combo box or some type of text like "Loading.." while is retreiving the next batch of data from the server and showing it in the UI?
Princy
Top achievements
Rank 2
 answered on 30 Jun 2011
2 answers
130 views
Hi all,

My project has grown outside the scope of the functionality provided by RadDockLayout. I am hoping to create my own manager class which emulates the functionality currently provided to me by RadDockLayout. 

So, I have classes which inherit from RadDock and RadDockZone, CormantRadDock and CormantRadDockZone. I am letting RadDockLayout manage these objects, but it is a pain to constantly have to cast my RegisteredDocks collection constantly. In addition, I do the same sort of control regeneration that RadDockLayout provides, except applied to more controls. As such, I have a firm understanding of what is needed to manage these controls.

That being said, I would like to make sure I do not miss any hidden dependencies.

So, I use the events for RadDockLayout_SaveDockLayout and LoadDockLayout. I believe I can just append additional code to the Page_Load method to emulate what is occurring in RadDockLayout_LoadDockLayout (please correct me if this is an incorrect belief). I am unsure of how to emulate RadDockLayout_SaveDockLayout -- and would like some advice. How can my manager trigger on this event? 

Other than that, is there anything hidden going on that I should be aware of that would make removing RadDockLayout from a page full of dynamic RadDocks and RadDockZones?

Thanks

Sean
Pero
Telerik team
 answered on 30 Jun 2011
1 answer
53 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
239 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
71 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
91 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
232 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
318 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
66 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?