Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
94 views
In a user control that contains a RadGrid, I am trying to get the header text for the column that is being sorted on. I am doing this in the prerender of the control so all the databinding should have happened already. For some reason the column does not give me the correct text. For some columns the text is changed in the needdatasource event but that should happen before my routine is called. Here is the code. Is there a better way to do this?

private void Set508SortMessage()
{
    if (RadGrid1.MasterTableView.SortExpressions.Count > 0)
    {
        ATSortPane.Visible = AccessibilityMode;
        String msg = GetString("ActionWorklist.SortCriteria.DisplayText.Text");
        String sort = "";
        bool firstTime = true;
        foreach (GridSortExpression gse in RadGrid1.MasterTableView.SortExpressions)
        {
            if (!firstTime)
            {
                sort = sort + ",";
            }
            Common.Framework.SortDirection sd = GetSortDirection(gse.SortOrder);
            sort = string.Format("{0}{1} {2}", sort, RadGrid1.MasterTableView.Columns.FindByDataField(gse.FieldName).HeaderText, sd);
            firstTime = false;
        }
        lbl508Sort.Text = String.Format(msg, sort);
    }
    else
    {
        ATSortPane.Visible = false;
    }
}
Tsvetoslav
Telerik team
 answered on 24 Nov 2010
1 answer
175 views
I have several multiselect comboboxes, the entries are populated from a datasource.  Each entry has a checkbox.  I do an autopostback.  I know how to get the selected item if it's a single select, but what do I do for a multiselect?  Thanks.
Shinu
Top achievements
Rank 2
 answered on 24 Nov 2010
2 answers
84 views
Hi,
I used rad rotator for rotating the latest 10 images from a folder by retrieving their names from database.
This is working but image borders are rotating i.e., images are not displaying in the rotator

here is my aspx code
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="120px" Width="680px">
<telerik:RadRotator ID="RadRotator1" runat="server" Height="120px" Width="680px" ScrollDuration="500"
ScrollDirection="Right" FrameDuration="1500" ItemWidth="120px" ItemHeight="100px" RotatorType="AutomaticAdvance"
DataSourceID="SqlDataSource1">
<ItemTemplate>
<asp:Image ID="image1" runat="server" CssClass="image" ImageAlign="left" Visible="true"
ImageUrl='<%# String.Format("~/images/movies/{0}", DataBinder.Eval(Container.DataItem, "imagename")) %>' />
</ItemTemplate>
  </telerik:RadRotator>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:cinema mistakesConnectionString %>"
SelectCommand="SELECT TOP 10 [imagename] FROM [movie] ORDER BY [mid] DESC"></asp:SqlDataSource>
                        </telerik:RadAjaxPanel>

pls get me out of this
saratchand
Top achievements
Rank 2
 answered on 24 Nov 2010
1 answer
85 views
I am trying to incorporate the following function into the 'Delete' functionality of the RadGridView:

Protected

 

Sub RadGridApprovers_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridApprovers.ItemCommand

 

 

If e.CommandName = "Delete" Then

 

 

 

    'do something
End
If

 

 


End
Sub


My question is: does the delete happen first or whatever commands I includein this function?

thank you

 

Shinu
Top achievements
Rank 2
 answered on 24 Nov 2010
1 answer
424 views
What event can I use to populate a radcombobox in filter template in a radgrid from server side code. I do not have the ability to use datasource referenced on the page.  Can I do in it in the radgrid OnColumnCreated or ondatabound events?
Princy
Top achievements
Rank 2
 answered on 24 Nov 2010
1 answer
114 views
I am trying to get my scheduler entries to show up in order of a resource (called PeriodID). The resource is used to store the ID of the Period selected (from the Period Table) as follows:

On Call (ID=1)
AM (ID=2)
PM (ID=3)
All Day (ID=4)

I am using SQL Datasources for binding.

I have tried using Order By PeriodID in the Datasource Select statement for the Schedule Data but that doesn't work. I then tried creating a class and using the appointmentcomparer as shown here http://www.telerik.com/community/forums/aspnet-ajax/scheduler/oder-of-entry-in-scheduler.aspx#1155620 but that adds another field to the Advanced form for manual PeriodID entry which is not what I need.

Does anyone know how to have the scheduler order entries by Resource? Thanks.
GlenB
Top achievements
Rank 1
 answered on 24 Nov 2010
0 answers
136 views

I'm having difficulty getting the RecurrenceEditor to populate from existing values.

Here's Telerik's example on how to populate the control:
http://www.telerik.com/help/aspnet-ajax/recurrenceeditor_serverside_populating.html

I created some code to read my selection and it spits out:

 


Recurrence Rule Text: 
DTSTART:20101124T173647Z DTEND:20000102T000000Z RRULE:FREQ=DAILY;UNTIL=20101130T000000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR 
  
Scheduled Dates 
  
11/24/2010 5:36:47 PM
11/25/2010 5:36:47 PM
11/26/2010 5:36:47 PM
11/29/2010 5:36:47 PM

The control's state renders fine between post backs.  I then store the Recurrence Recurrence Rule Text in my database but when I try to read it back to the control later on I get nothing.  None of the items are selected in the control and even the Recurrence Checkbox isn't selected?  So, how do I assign this control it's values?  Here's my assignment code:


protected
void Page_Load(object sender, EventArgs e)
{
    this.RecurrenceEditor1.StartDate = Convert.ToDateTime("11/24/2010 5:36:47 PM");
    this.RecurrenceEditor1.RecurrenceRuleText = "DTSTART:20101124T173647Z DTEND:20000102T000000Z RRULE:FREQ=DAILY;UNTIL=20101130T000000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR";
}

Any help would be appreciated,

Thanks,

Robert
Top achievements
Rank 1
 asked on 23 Nov 2010
3 answers
292 views
Folks,

Is it possible to show/hide RadComboBox depending on the RadioButtionListSelected Value? For example In RadioButtonList1_SelectedIndexChanged event, if my RadioButtonList1's selected Value = "1", show RadcomboBox (CountryName), else hide the RadComboBox.  Both My RadioButtonList and ComboBox are within EditTemplate of RadGrid.

Below is my code.

Thanks

<telerik:GridTemplateColumn DataField="rblLIST" HeaderText="rbl" UniqueName="rBL">
                        <EditItemTemplate>
                         
                               <asp:RadioButtonList ID="RadioButtonList1" runat="server"  AutoPostBack = "true"
                                onselectedindexchanged="RadioButtonList1_SelectedIndexChanged" 
                                RepeatDirection="Horizontal">
                                    <asp:ListItem Text="Yes" Value="1"></asp:ListItem>
                <asp:ListItem Text="No" Value="2"></asp:ListItem>
  
                            </asp:RadioButtonList>     
                              
                             
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                      
                    <telerik:GridTemplateColumn DataField="CountryName" HeaderText="Country" UniqueName="CountryName">
                      
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("CountryName") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="rcbCountries"  
                                runat="server" 
                                AutoPostBack="true"
                                Skin="Vista"                                         
                                DataTextField="Name" 
                                DataValueField="CountryID">                                
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>


gc_0620
Top achievements
Rank 1
 answered on 23 Nov 2010
4 answers
107 views
Hi there,

I have a page with RadSplitter which contains RadGrid and my custom user control (Footer) in two separate
RadPanes. I enabled ajax on the grid, but I would like to update the footer with ajax as well. In code
below I have tried inserting the footer id or the id of a panel that wraps the footer as ControlID in
AjaxUpdateControl tag. None of them worked and they even caused that the RadGrid doesn't work properly
(when I click on the next page button, it doesn't change the page, but loading icon is shown).
The footer user control contains only <%Reponse.Write(DateTime.Now);%>.

What am I missing?


<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid" UpdatePanelHeight="100%" />
                            <telerik:AjaxUpdatedControl ControlID="***WhatShouldBeHere?***" UpdatePanelHeight="100%" />
                    
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadSplitter ID="RadSplitter" runat="server" Orientation="Horizontal">
        <telerik:RadPane ID="TitleRadPane" runat="server" Height="26px" >
          <!-- ...... -->
        </telerik:RadPane>
        <telerik:RadPane ID="ContentRadPane" runat="server" Scrolling="None">
            <telerik:RadGrid
                ID="RadGrid"     
                DataSourceID="MasterObjectDataSource"
                EnableLinqExpressions="false"
                OnUpdateCommand="UpdateGrid"
                OnInsertCommand="UpdateGrid"
                OnDeleteCommand="DeleteItem"
                runat="server">
 
                <ClientSettings>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
 
                <MasterTableView CommandItemDisplay="Top" AllowSorting="true" DataSourceID="MasterObjectDataSource" AllowFilteringByColumn="True" IsFilterItemExpanded="False" DataKeyNames="Id">
 
                    <CommandItemTemplate>
                       <!-- .... -->
                    </CommandItemTemplate>
 
                    <EditFormSettings UserControlName="AreaDetail.ascx" EditFormType="WebUserControl">
                        <EditColumn UniqueName="DummyEditColumnUniqueName">
                        </EditColumn>
                    </EditFormSettings>
 
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
 
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
 
                    <Columns>
                       <!-- .... -->
                    </Columns>
                </MasterTableView>
                <SelectedItemStyle Wrap="True" />
                <SortingSettings SortedBackColor="" EnableSkinSortStyles="false" />
            </telerik:RadGrid>
        </telerik:RadPane>
 
        <telerik:RadPane ID="FooterRadPane" runat="server" Height="100">
            <asp:Panel ID="FooterPanel" runat="server">
                <metTrade:Footer ID="Footer" runat="server">
                </metTrade:Footer>
            </asp:Panel>
        </telerik:RadPane>
    </telerik:RadSplitter>
steve
Top achievements
Rank 1
 answered on 23 Nov 2010
2 answers
115 views
I have tried several attempts to add a item to the HeaderContextMenu. I was able to add a item utilizing this method
 
Protected Overloads Overrides Sub OnPreRenderComplete(ByVal e As EventArgs)
          
        Dim menu As RadContextMenu = rgvSchedules.HeaderContextMenu 
        Dim item As New RadMenuItem()
        item.Text = "Paste Results"
        item.PostBack = True
        menu.Items.Add(item)
        MyBase.OnPreRenderComplete(e)
    End Sub

The Postback method is because I was attempting to find a way to set a server side procedure on click. I removed the excess code from my failed attempts. There inlies the problem. I cannot for the life of me find a way to set the onclick method for the item that I added and when it is clicked I get a runtime error:

Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Thomas
Top achievements
Rank 1
 answered on 23 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?