Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
147 views
Hi I have a grid as following
  <telerik:RadListView ID="AListGrid" runat="server" AllowPaging="true" PageSize="10" 
                AllowCustomPaging="True" ItemPlaceholderID="PropertiesContianer"
                <LayoutTemplate> 
                    <fieldset id="RadListView1"
                        <div class="proGridTopPager"
                            <telerik:RadDataPager ID="RadDataPager2" runat="server" Style="border: none;" SkinID="ListViewSkin" 
                                AllowSEOPaging="true" SEOPagingQueryPageKey="Page"
                                <Fields> 
                                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> 
                                    <telerik:RadDataPagerButtonField FieldType="Numeric" /> 
                                    <telerik:RadDataPagerButtonField FieldType="NextLast" /> 
                                </Fields> 
                            </telerik:RadDataPager> 
                        </div> 
                        <asp:PlaceHolder ID="PropertiesContianer" runat="server" /> 
                        <telerik:RadDataPager ID="RadDataPager1" runat="server" Style="border: none;" SkinID="ListViewSkin" 
                            AllowSEOPaging="true" SEOPagingQueryPageKey="Page"
                            <Fields> 
                                <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> 
                                <telerik:RadDataPagerButtonField FieldType="Numeric" /> 
                                <telerik:RadDataPagerButtonField FieldType="NextLast" /> 
                            </Fields> 
                        </telerik:RadDataPager> 
                    </fieldset> 
                </LayoutTemplate> 
                <ItemTemplate> 
                    <osl:descContent ID="lbltest" runat="server" Text="" /> 
                </ItemTemplate> 
            </telerik:RadListView> 

and in my code-behind, i got
Private Sub AListGrid_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadListViewItemEventArgs) Handles AListGrid.ItemDataBound 
 If (TypeOf (e.Item) Is RadListViewDataItem) Then 
   Dim dataBoundItem = DirectCast(e.Item, RadListViewDataItem) 
   Dim atest = DirectCast(dataBoundItem.FindControl("lbltest"), descContent) 
   atest.Text = "test" 
 End If 
End Sub 

it works only on first page, not the 2 second and etc, even if we start with second page, the web user control does not render (it just contain a simple label)
Telerik version 2010.1.316.35

It seems calling ItemDataBound event twice if page >1, any idea?
James Shelton Agar
Top achievements
Rank 2
 answered on 17 Mar 2010
1 answer
119 views
Hello,

  I have a RadGrid built in the code behind and displayed on the page at run time.  I'd like to display the last page rather than the first page.  I searched around but couldn't find an example or anything on how to do this.  It's been awhile since I've worked with the RadGrid so I may just be overlooking the obvious.

Thanks for any help
Kevin
robertw102
Top achievements
Rank 1
 answered on 17 Mar 2010
4 answers
170 views
Hi All,

I am doing Insert, Update in RadGrid at server side, and working fine, but i am not able to change edit mode to normal mode after update is complete.

How to change edit mode after update complete in RadGrid1_UpdateCommand event.

Please help me regarding this.


J
Top achievements
Rank 1
 answered on 17 Mar 2010
1 answer
86 views

I have a page that has a RadWindowManager on it.
I have a button on that page and below is the code in the Click event of that button.
It opens the page EmailSend.aspx in a RadWindow.

                RadWindow window = new RadWindow();
                window.ID = "EmailSend";
                window.NavigateUrl = "/EmailSend.aspx";
                window.VisibleOnPageLoad = true;
                window.Behaviors = Telerik.Web.UI.WindowBehaviors.Close;
                window.Height = 800;
                window.Width = 960;
                RadWindowManager1.VisibleOnPageLoad = true;
                window.Title = "Email  Release";
                RadWindowManager1.Windows.Add(window);

Page EmailSend.aspx is a form the user types all the information into that they want emailed.
When the user clicks the Send Button on this form, I have code that inserts the email information into the database.

After this code executes, I have the following line: (I want the window to close when the User clicks Send)

ScriptManager.RegisterStartupScript(this, GetType(), "EmailSend", "CloseRadWindow();", true);

In the Source of EmailSend.aspx, I have the following in the Send button.
<asp:Button ID="btnSend" runat="server" Text="Send" OnClick="btnSend_Click" OnClientClick="CloseWnd();return false;" />

I also have the following function in the Source of EmailSend.aspx
       <script type="text/javascript">
           function GetRadWindow() {
               var oWindow = null;
               if (window.radWindow) oWindow = window.radWindow; 
               else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;

               return oWindow;
           }
           function CloseWnd() {
               GetRadWindow().close();
           }
        </script>

This kind of works but I must be missing something.  I read that RadWindows don't close, they just hide themselves.  I think this is the problem I am having.  The first time I click the button that opens EmailSend.aspx in a RadWindow, I click Send and it runs my code and closes.  If I open it a second time, I have to click Send twice for it to close.  If I open it a third time, i have to click Send three times for it to close.  What am I doing wrong?????

Lori
Top achievements
Rank 1
 answered on 17 Mar 2010
2 answers
99 views
Hi,
   I have developed the website in VS2008 with WindowsXP and it can run well in server 2003. But when I move the site into server2008, all the controls can not click. It can show the controls but can't click. for example, TreeView can show correct, but can't choose the nodes, can't use right click menu. and RadMenu has the same problem. Should I change any setting in IIS 7 or in web.config
Veenu
Top achievements
Rank 1
 answered on 17 Mar 2010
17 answers
352 views

How do display multiple columns in the load by demand example?
The following code from the multi-col does not display the data.
Do I have to bind the datatable to the combox for this to work.
It seems the databinding to the radcombo takes a while.. thanks in advance.

<

HeaderTemplate>

<table style="width: 100%; text-align: left">

<tr>

<td style="width: 125px;">

Company Name

</td>

<td style="width: 125px;">

City

</td>

<td style="width: 125px;">

Title

</td>

</tr>

</table>

</HeaderTemplate>

<ItemTemplate>

<table style="width: 100%; text-align: left">

<tr>

<td style="width: 125px;">

<%

# DataBinder.Eval(Container.DataItem, "CompanyName") %>

</td>

<td style="width: 125px;">

<%

# DataBinder.Eval(Container.DataItem, "City") %>

</td>

<td style="width: 125px;">

<%

# DataBinder.Eval(Container.DataItem, "ContactTitle") %>

</td>

</tr>

</table>

</ItemTemplate>

Jill McLoughlin
Top achievements
Rank 1
 answered on 17 Mar 2010
4 answers
156 views
I'm using this example http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandsplitterresizing/defaultcs.aspx?product=splitter (Resizing RadGrid in RadSplitter) to help with resizing my RadGrid.  However, I'm getting the following javascript error: Line: 107
Error: 'null' is null or not an object

The error is occurring when it's trying to call the changepagesize function.

The grid and splitter on in a content page.  Any help would be appreciated.

ASPX
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxManagerProxy1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="ARGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting>          
            <telerik:AjaxSetting AjaxControlID="rcbCodeList">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rcbListType"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="rtbCode" /> 
                    <telerik:AjaxUpdatedControl ControlID="btnAddCode" /> 
                    <telerik:AjaxUpdatedControl ControlID="rlbCodes"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="rcbListType">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rtbCode" /> 
                    <telerik:AjaxUpdatedControl ControlID="btnAddCode" /> 
                    <telerik:AjaxUpdatedControl ControlID="rlbCodes"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="btnAddCode">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rtbCode"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                     <telerik:AjaxUpdatedControl ControlID="rlbCodes"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls>                  
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="ARGrid1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="ARGrid1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">  
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
 
    </telerik:RadCodeBlock> 
           <script type="text/javascript">  
               function ClientResized(sender, eventArgs) {  
                   alert('in resize');  
                   var test = $find("<%= RadAjaxManagerProxy1.ClientID %>");  
 
                   alert('found proxy');  
                   $find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest('ChangePageSize');  
                   alert('changed size');  
                   //  if ($find("<%= RadAjaxManagerProxy1.ClientID %>").visible)  
                   // {  
                   //$find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest('ChangePageSize');  
                   //}  
               }  
        </script> 

 

<telerik:RadPane ID="gridPane" runat="server" Height="400px" Scrolling="None" OnClientResized="ClientResized">

 

 

<table border="0" width="986px" cellpadding="0" cellspacing="0" style="background-color:White;table-layout:fixed">

 

 

<tr valign="top">

 

 

<td width="15px"><img src="images/spacer.gif" width="15px" alt="" /></td>

 

 

<td style="height:400px;">

 

 

<table border="0" cellpadding="0" cellspacing="0" width="986px" style="background-color:White;table-layout:fixed" >

 

 

<tr>

 

 

<td>

 

 

<telerik:RadGrid ID="ARGrid1" runat="server" Width="95%" GridLines="None"

 

 

PageSize="50" AllowSorting="True" AllowPaging="True" Visible="false"

 

 

OnNeedDataSource="ARGrid1_NeedDataSource" ShowStatusBar="true" ShowGroupPanel="true" Skin="Outlook" >

 

 

<MasterTableView AllowFilteringByColumn="true" AllowMultiColumnSorting="true" Width="100%" CommandItemDisplay="None" AutoGenerateColumns="true">

 

 

 

<Columns>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" ColumnsReorderMethod="Reorder" >

 

 

<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="false" FrozenColumnsCount="1" ScrollHeight="100%" />

 

 

<Resizing ClipCellContentOnResize="false" AllowColumnResize="true" />

 

 

</ClientSettings>

 

 

<GroupingSettings ShowUnGroupButton="true" />

 

 

</telerik:RadGrid>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</telerik:RadPane>

 


Server code:
       protected void RadAjaxManagerProxy1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)  
        {  
            switch (e.Argument.ToString())  
            {  
                case "ChangePageSize":  
                    //Calculate the number of rows that fit in the RadPane.  
                    //In this case 23 is the sum of the height of a single row and its upper border width.  
                    //Depending on the paticular scenario this value may vary.  
                    int rows = (Int32.Parse(this.gridPane.Height.Value.ToString()) - 60) / 23;  
                    if (rows >= 1)  
                    {  
                        ARGrid1.PageSize = rows;  
 
                        // Check whether the CurrentPageIndex is correct.  
                        if (Session["itemsCount"] != null)  
                        {  
                            int itemsCount = (int)Session["itemsCount"];  
                            int pageCount = (int)Math.Ceiling(((double)itemsCount / rows));  
                            if (ARGrid1.MasterTableView.CurrentPageIndex > pageCount - 1)  
                            {  
                                ARGrid1.MasterTableView.CurrentPageIndex = pageCount - 1;  
                            }  
                        }  
 
                        ARGrid1.Rebind();  
                    }  
                    break;  
            }  
        }  
 
        public string RadGrid1PanelClientID;  
 
        protected void RadAjaxManagerProxy1_AjaxSettingCreated(object sender, AjaxSettingCreatedEventArgs e)  
        {  
            if (e.Initiator.ID == "ARGrid1")  
            {  
                this.RadGrid1PanelClientID = e.UpdatePanel.ClientID;  
            }  
        } 
Michael
Top achievements
Rank 1
 answered on 17 Mar 2010
2 answers
200 views
I am having an issue with expanding a second detailtable in a RadGrid.  Whenever I try and expand the second level, the whole RadGrid collapses.  This also happens when expanding other rows from the MasterTableView.  I included snips below of the code.  Any help would be greatly appreciated.  In the code behind, please note that the GetSubmissionResults and the GetSubmissions are webservice calls. 

Thanks in advance.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server"   
            GridLines="None" AutoGenerateColumns="False" PageSize="20"   
            MasterTableView-Width="100%"   
            OnDetailTableDataBind="URLGrid_DetailTableDataBind" 
            Visible="True">  
    <MasterTableView ItemStyle-Width="100%" NoMasterRecordsText="No Results Found"   
            NoDetailRecordsText="No ResultsFound" Visible="true"   
            datakeynames="SubmissionGroupID" ExpandCollapseColumn-ItemStyle-BackColor="#CCCCCC">  
        <DetailTables> 
                <telerik:GridTableView DataKeyNames="SubmissionID" runat="server" Width="100%" Name="caseURLs">  
                    <DetailTables> 
                        <telerik:GridTableView runat="server" Name="caseDetails">  
                            <expandcollapsecolumn visible="True">  
                            </expandcollapsecolumn> 
                     <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="SubmissionID" MasterKeyField="SubmissionID" /> 
                    </ParentTableRelation> 
                            <Columns> 
                            <telerik:GridBoundColumn DataField="SubmissionID" Visible="false">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionID"   
                                HeaderText="ID" ShowSortIcon="false" UniqueName="column">  
                            </telerik:GridBoundColumn> 
                            </Columns> 
                        </telerik:GridTableView>                      
                    </DetailTables> 
                 <expandcollapsecolumn visible="True"></expandcollapsecolumn> 
                <Columns> 
                        <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionID"   
                            HeaderText="ID" ShowSortIcon="false" UniqueName="column">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn AllowSorting="false" DataField="AbsoluteUrl"   
                            HeaderText="URL" ShowSortIcon="false" UniqueName="column">  
                        </telerik:GridBoundColumn> 
                </Columns> 
            </telerik:GridTableView> 
        </DetailTables> 
 
                <expandcollapsecolumn visible="True">  
                </expandcollapsecolumn> 
            <Columns> 
                <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionGroupID"   
                    HeaderText="Group" ShowSortIcon="false" UniqueName="column">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn AllowSorting="false" DataField="Baseline"   
                    HeaderText="Baseline" ShowSortIcon="false" UniqueName="column">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn AllowSorting="false" DataField="Description"   
                    HeaderText="Description" ShowSortIcon="false" UniqueName="column">  
                </telerik:GridBoundColumn> 
            </Columns> 
              
              
            <NoRecordsTemplate><div align="center">No Results Found</div></NoRecordsTemplate>  
            <expandcollapsecolumn visible="True">  
                <ItemStyle BackColor="#CCCCCC" /> 
            </expandcollapsecolumn> 
 
 
        <ItemStyle Width="100%" /> 
    </MasterTableView>      
    </telerik:RadGrid> 

Code Behind <snip> :

protected void URLGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)  
    {  
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;  
          
        switch (e.DetailTableView.Name) {  
 
            case "caseURLs": {  
            int groupID = (int)dataItem.GetDataKeyValue("SubmissionGroupID");  
            submissionView = WebServiceClient.GetSubmissions(groupID);  
            e.DetailTableView.DataSource = submissionView;  
                break;  
            }  
 
            case "caseDetails": {  
                int detailsID = (int)dataItem.GetDataKeyValue("SubmissionID");  
            submissionResults = WebServiceClient.GetSubmissionResults(detailsID, ResultType.Passed);  
            e.DetailTableView.DataSource = submissionResults;  
                break;  
            }  
        }   
    }  
 

louis chan
Top achievements
Rank 1
Iron
 answered on 17 Mar 2010
4 answers
212 views
Hi,
    I used this example to customize the advanced form http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx
  When opening a recurrence event or an all day event more than one time (open the advance form then close and then re-open), the recurrence checkbox is still checked, but it doesn't expand to show the recurrence options.  If it's an all day event, the all day checkbox is checked, but the Start Time and End Time are still shown up. 
Does anybody have a workaround for that?  It seems like it's a Javascript problem from the example.
Thank you
Mike
Top achievements
Rank 2
 answered on 17 Mar 2010
1 answer
103 views
Hi!

On your editor demo page if you click template manager the dialog shows the preview styled in default settings. This seems to be hardcoded styling in the template-html. Is there a way to use a css-file for this instead. Preferably the editor.CssFiles already loaded.

To clarify: I want the preview to be styled without having to do it inline in the template html.

Thanx

Rumen
Telerik team
 answered on 17 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?