Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
195 views
Hello,

I'm having a problem converting my standard ASP.NET GridView with it's settings to a RadGrid solution.  I've been struggling with this trying different options, but with no solution.

I have a page with an ASP.NET GridView, a DropDownList for "ItemsPerPage" selector, and a custom pager that uses the querystring to pass the pageNumber to my ObjectDataSource for SEO friendliness, I have EnablePaging="false".  Everything here works fine, both the customer pager and the DDL for selecting the pageSize.

I'm trying to convert all of this to use the RadGrid, RadComboBox, and was hoping to use the RadGrid's pager functionality using EnableSEOPaging, or even use my custom pager, but either instance is causing a problem.  Here are the options I've tried with partial success, each causing a different and frustrating conundrum.

Option 1)  Using the RadGrid with it's pager and EnableSEO="true" SEOPagingQueryStringKey="page".  This works GREAT !!
But my RadComboBox for the "ItemsPerPage" only works on the current page, when selecting "next page" the pageSize of the RadComboBox does not persist to the next page, it sets itself back to the Default pageSize.  (I'm thinking it has something to do with setting the PageSize of either the RadGrid, or the MasterTableView)

Option 2)  Using the RadGrid and Pager Template like in the sample at: Page Template Demo.  Once again, this works GREAT !!, the PagerTemplate with the paging and RadComboBox for "ItemsPerPage" set in the MasterTableView works !, but I can't seem to get EnableSEOPaging to work for template paging.  I know that SEO is automatically enabled when it spots a spider, but it's really important that I have this available for users,  they have the option to do a query with various filters and save it as a "Favorite" search page for later use.

So, my questions are, working backwords...
With option 2) Is there a way to EnableSEOPaging with template paging, either programmatically, javascript, or otherwise ?
OR
With option 1)  Get the RadComboBox for "ItemsPerPage" (which is outside the RadGrid) to persist and not reset.
Here's the code that I used in my standard GridView and DropDownList that works:
protected void Page_Load(object sender, EventArgs e) 
      { 
         if (!this.IsPostBack) 
         { 
            // Set the page size as indicated in the config file. If an option for that size 
            // doesn't already exist, first create and then select it. 
            int pageSize = Globals.Settings.Entities.PageSize; 
            if (ddlItemsPerPage.Items.FindByValue(pageSize.ToString()) == null
               ddlItemsPerPage.Items.Add(new ListItem(pageSize.ToString(), pageSize.ToString())); 
            ddlItemsPerPage.SelectedValue = pageSize.ToString(); 
             
            gvwEntities.PageSize = pageSize; 
            gvwEntities.DataBind(); 
         } 
      } 
 
      protected void ddlItemsPerPage_SelectedIndexChanged(object sender, EventArgs e) 
      { 
         gvwEntities.PageSize = int.Parse(ddlItemsPerPage.SelectedValue); 
         gvwEntities.PageIndex = 0; 
         gvwEntities.DataBind(); 
      } 

And, here is the code (very similiar) after changing to a RadGrid and RadComboBox, but doesn't change the PageSize for every page, only the current page:
protected void Page_Load(object sender, EventArgs e) 
      { 
         if (!this.IsPostBack) 
         { 
            // Set the page size as indicated in the config file. If an option for that size 
            // doesn't already exist, first create and then select it. 
            int pageSize = Globals.Settings.Entities.PageSize; 
            if (rcbItemsPerPage.Items.FindItemByValue(pageSize.ToString()) == null
               rcbItemsPerPage.Items.Add(new RadComboBoxItem(pageSize.ToString(), pageSize.ToString())); 
            rcbItemsPerPage.SelectedValue = pageSize.ToString(); 
 
            rgdEntities.PageSize = pageSize; 
            rgdEntities.DataBind(); 
         } 
      } 
 
      protected void rcbItemsPerPage_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
      { 
         rgdEntities.PageSize = int.Parse(rcbItemsPerPage.SelectedValue); 
         rgdEntities.CurrentPageIndex = 0; 
         rgdEntities.DataBind(); 
      } 

Sorry for the lengthy post, I just wanted to be as clear as possible, I hope I was.
Any assistance in getting either option to work would be greatly appreciated.

Thank you in advance,
Ronnie











Ronnie
Top achievements
Rank 1
 answered on 06 Mar 2009
1 answer
74 views

Hi All,
I have just upgraded my Telerik version to ASP.NET AJAX - 2008.3 1314 from Q2 2008.

Everything seems normal except Radwindow.

I am defining radwindow as ,

<telerik:RadWindowManager ID="rWindowManager" runat="server" 
ClientCallBackFunction="CallBackCustomerData" Height="4px" Left="" 
Skin="Vista" Top="" Behavior="Close,Reload" InitialBehavior="None" 
style="display: none;">  

 

<windows> 
<telerik:RadWindow ID="rWindowDeal" runat="server" Height="200px" 
Left="50px" Modal="True" NavigateUrl="" ReloadOnShow="True" Title="Deal" 
Top="50px" VisibleStatusbar="False" Width="440px" />

</windows>
</RadWindowManager>

My javascript function is,

function OpenWindow()
{
    radopen("frmTest.aspx","rWindowDeal"); (before upgradation it was window.radopen(...))
}
Now I have set window Left and Top as 50 but still it is opening window in left top corner of the widnow.

Also, another problem is sometimes it shows window with specified height and wit\dth but sometimes it shows full scren (same as parent height and width).

Can anyone help me out please?

Best Regards,
Hrushikesh.

Georgi Tunev
Telerik team
 answered on 06 Mar 2009
3 answers
129 views
Hi,
I have the following problem: when I set an IEnumerable collection as a data source to a RadGrid control that has EnableLinqExpressions property set to false then the first element of the collection is displayed twice in the grid. The IEnumerable collection consists of objects of different types but with common base type. My version of the control is 2008.3.1314.35.
I made some search in the Telerik.Web.UI assembly and I think the problem is in the AdvancedEnumerator class that returns the first element twice. Is there really a problem with that class or the problem is somewhere in my code?
Thanks in advance
Rosen
Telerik team
 answered on 06 Mar 2009
1 answer
105 views
Hi there,

I have a web application project that I upgraded from Visual Studio 2005 to Visual Studio 2008.
Now, on every page that I have a telerik tooltip, I get this error:

Error 1 Value of type 'System.Web.UI.UpdatePanel' cannot be converted to 'System.Web.UI.UpdatePanel'. Type mismatch could be due to mixing a file reference to 'C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\System.Web.Extensions.dll' in project '1_Mobile_MobileExpenseEdit.aspx' with a file reference to 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll' in project 'Webvantage'. If both assemblies are identical, try replacing these references so both references are from the same location. C:\Visual Studio 2005\Projects\Webvantage.3.00.0\Webvantage\BillingApproval_Approval.aspx.vb 219 38 Webvantage

 

Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs)

 

 

Me.UpdateToolTip(args.Value, args.UpdatePanel)

 

 

End Sub

 


The "args.UpdatePanel" is what throws the error.
I don't have any references to System.Web.Extensions that isn't version 3.5.0.0 in the project references.
And the the upgrade process put this in the web.config:

<

 

runtime>

 

<

 

assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

 

<

 

dependentAssembly>

 

<

 

assemblyIdentity name="System.Web.Extensions"

 

 

 

publicKeyToken="31bf3856ad364e35"/>

 

<

 

bindingRedirect oldVersion="1.0.0.0-1.1.0.0"

 

 

 

newVersion="3.5.0.0"/>

 

</

 

dependentAssembly>

 

<

 

dependentAssembly>

 

<

 

assemblyIdentity name="System.Web.Extensions.Design"

 

 

 

publicKeyToken="31bf3856ad364e35"/>

 

<

 

bindingRedirect oldVersion="1.0.0.0-1.1.0.0"

 

 

 

newVersion="3.5.0.0"/>

 

</

 

dependentAssembly>

 

</

 

assemblyBinding>

 

</

 

runtime>


So where does it think that v1.0.61025 is being referenced?
I'm using other telerik ajax controls, and it seems only the tooltip is throwing errors....

 

Svetlina Anati
Telerik team
 answered on 06 Mar 2009
1 answer
89 views
I am working for a client who requires the use of different icons displayed instead of the default ones in the editor toolbar.

The icons he has created are 30px x 30px so they are larger than the default ones used in the CommandSprites.gif. They are also seperate images for each button not like the line of buttons in the CommandSprites.gif.

So far I have managed to display each of them them via CSS as follows:
        
        .rade_toolbar.MySkin .Save
        {
            background-image: url(MySkin/ToolBarImages/Save.png);
            background-position: center;
            background-repeat: no-repeat;
            width: 30px;
            height: 30px;
        }
       .rade_toolbar.MySkin .Print
        { ..... etc...

And in the Editor declaration area I have done the following:

        <telerik:RadEditor ID="RadEditor1" runat="server" EnableEmbeddedSkins="False" Skin="MySkin">
            <Tools>
                <telerik:EditorToolGroup>
                    <telerik:EditorTool name="Save" text="Save" ShowIcon="true" />
                    <telerik:EditorTool name="Print" text="Print" ShowIcon="true" />
                    etc...

The problem is, I have searched every help file, every forum, the online documentation etc. but nothing decribes the structure of the CSS that is used for the toolbar in the editor. My client is using Telerik RadControls for ASP.NET Ajax version 2008.03.1409.20.

I want to use some of the CSS used in the Vista skin and have copied this to a file called MySkin however all the info I have been reading seems to be for all different versions of these skins and editors and not much of it makes sense.

Just a Clear explaination as to how to do what I am doing here would be much appreciated by anyone. I would like to place the icons where I want them on the top (which I have had some success with) and use some of the CSS structures originating from the vista skin.

Please note: I am not asking about how to do custom buttons here, that is already understood, I need to replace the existing CommandSprites.gif buttons with my own custom made icon buttons that are 30px x 30px
Martin
Telerik team
 answered on 06 Mar 2009
1 answer
173 views
Hi All. I've been using the RadPanelBar with ItemTemplate. I've noticed that there is a little bit of white space at the bottom of each RadPanelItem maybe only 1-2px in size. Is this part of the default css for the RadPanelItem. Is there any way to get rid of it? Example code:

<telerik:RadPanelBar ID="rpbRight" runat="server" Skin="Vista" Width="200px" ExpandMode="SingleExpandedItem"
                                                            PersistStateInCookie="True">
                                                            <CollapseAnimation Type="InOutQuad" Duration="400"></CollapseAnimation>
                                                            <Items>
                                                                <telerik:RadPanelItem runat="server" Text="Citrix Usage">
                                                                    <Items>
                                                                        <telerik:RadPanelItem Enabled="True">
                                                                            <ItemTemplate>
                                                                                <%=GetCitrixUsage() %>
                                                                            </ItemTemplate>
                                                                        </telerik:RadPanelItem>
                                                                    </Items>
                                                                </telerik:RadPanelItem>
                                                            </Items>
                                                            <ExpandAnimation Type="InOutQuad" Duration="400"></ExpandAnimation>
                                                        </telerik:RadPanelBar>

Paul
Telerik team
 answered on 06 Mar 2009
1 answer
114 views
I am using dynamically created docks. I am adding charts and all sorts into those docks.
I note  that when a dock is closed it is simply hidden.

Thus on every render all the docks and contents for every dock ever created is rendered *even if they are closed*.

I cannot see how to intervene in the state loading/saving to ensure closed docks' states aren't saved (or rehydrated).

How do I ensure that when a dock is closed it is destroyed utterly?

thanks

Petio Petkov
Telerik team
 answered on 06 Mar 2009
2 answers
180 views
We have a 4 layer hierarchy RADGrid (1 - MasterTableView and 3 GridTableViews).  On each layer there are 4 asp:LinkButtons(Divisions, Sites, Accounts, and Fiscal Year).  We want to expand or collapse the RADGrid by clicking on either the ExpandCollapseColumn or the asp:LinkButton.  For example we want the user to be able to click (or double-click) on the Division (or the <ExpandCollapseColumn>) and they would see the Sites GridTableView.  If they click it again it should collapse the Sites.  We currently handle the OnDetailTableDataBind,  OnItemCommand,  OnItemCreated, and OnNeedDataSource events. Can you provide some assistance on how to do this? It was suggested that this could be done by using Client-Side DataBinding but the example shows how to expand the first MasterTableView and first GridTableView only.

I have included the codel-behind (Visual Basic 2.0)

Protected Sub

rgCUBudget_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs)

 

 

 

    Dim

dataItem As Telerik.Web.UI.GridDataItem = CType(e.DetailTableView.ParentItem, Telerik.Web.UI.GridDataItem)

 

 

 

    Select Case

e.DetailTableView.Name

 

 

        Case "AccountDetail"

 

             

tbBudget = LoadObject(tbBudget)

 

             

tbBudget.AccountId = dataItem.GetDataKeyValue("account_id").ToString()

 

             

e.DetailTableView.DataSource = tbBudget.LoadBudgetAccountDetail()

 

 

 

        Case

"AccountSummary"

 

             

tbBudget = LoadObject(tbBudget)

 

             

tbBudget.SiteId = dataItem.GetDataKeyValue("site_id").ToString()

 

             

e.DetailTableView.DataSource = tbBudget.LoadBudgetAccountSummary()

 

 
        Case

"SiteSummary"

 

             

tbBudget = LoadObject(tbBudget)

 

             

tbBudget.DivisionId = dataItem.GetDataKeyValue("division_id").ToString()

 

 

            e.DetailTableView.DataSource = tbBudget.LoadBudgetSiteSummary()

 

     End Select

 

End Sub

 

 

Protected Sub

rgCUBudget_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)

 

     If

e.CommandName = "loadSites" Then

 

         For Each 

item As GridDataItem In rgCUBudget.Items

 

 

             If item.OwnerTableView.Name = "DivisionSummary" Then

 

                 

tbBudget = LoadObject(tbBudget)

 

                 

tbBudget.DivisionId = CType(item, GridDataItem).GetDataKeyValue("division_id").ToString()

 

             End If

        Next

    End If

 

End Sub

 

 


Protected Sub

rgCUBudgetDetail_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs)

 

     Dim

dataItem As Telerik.Web.UI.GridDataItem = CType(e.DetailTableView.ParentItem, Telerik.Web.UI.GridDataItem)

 

 
     Select Case

e.DetailTableView.Name

 

         

Case "AccountDetail2"

 

             

tbBudget = LoadObject(tbBudget)

 

             

tbBudget.AccountId = dataItem.GetDataKeyValue("account_id").ToString()

 

             

e.DetailTableView.DataSource = tbBudget.LoadBudgetAccountDetail()

 

         
         Case

"AccountSummary2"

 

 

             tbBudget = LoadObject(tbBudget)

 

             

tbBudget.SiteId = dataItem.GetDataKeyValue("site_id").ToString()

 

             

e.DetailTableView.DataSource = tbBudget.LoadBudgetAccountSummary()

 

 

 

         Case

"SiteSummary2"

 

 

            tbBudget = LoadObject(tbBudget)

 

 

            tbBudget.DivisionId = dataItem.GetDataKeyValue("division_id").ToString()

 

 

            e.DetailTableView.DataSource = tbBudget.LoadBudgetSiteSummary()

 

     End Select

 

End Sub

 

 


Darrell
Top achievements
Rank 1
 answered on 06 Mar 2009
2 answers
110 views
Hi,

Please help me to hide the dynamic grid which is created in page init and also i set enable viewstate to false
if possible give some examples in client or server side

regards,
sathies
sathies
Top achievements
Rank 1
 answered on 06 Mar 2009
3 answers
143 views
Hi there,

Is it possible that when a user clicks on the column header the grouping is redone so that the grid is grouped by the value of that column rather than the grid being sorted?

Regards, Richard
Richard
Top achievements
Rank 1
 answered on 06 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?