Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
246 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
77 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
93 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
237 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
325 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
67 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
145 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
95 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
91 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
2 answers
82 views
I am looking to use the scheduler with some drag and drop functionality.  I have seen the sample on this site where you can drag tasks onto the calendar and it will assign it to the time slot you were hovering over.  In my scenario, I am going to have an appointment in the calendar already.  And I want to be able to drag an item onto that calendar entry and be able to tie the two objects together in our database on the back end.

Here is the real life scenario.  I have jobs in the calendar.  I have a list of resources on the left hand side outside of the calendar object.  I want to be able to grab a resource from the list, drag it over to a job in the calendar and be able to assign that resource to the job.  Is there a trigger on an appointment like that where I would be able to recognize that something is being dropped on the appointment and not necessarily a timeslot in the calendar?
Plamen
Telerik team
 answered on 29 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?