Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
263 views

I changed something from demo example to my project and i use datasource in codebehind.  DataPager still works fine if i put RadListView datasource in PageLoad but DataPager doesn't work when i put RadListView datasource in event click of Button. Can you help me, please?

 - aspx:

<telerik:RadButton ID="RadButton1" runat="server" Text="RadButton" OnClick="Button1_Click"></telerik:RadButton>
        <br />
        <div>
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="ListViewPanel1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="ListViewPanel1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="0">
            </telerik:RadAjaxLoadingPanel>
            <asp:Panel ID="ListViewPanel1" runat="server">
                <telerik:RadListView ID="RadListView1" Width="97%" AllowPaging="True" runat="server"
                    allowsorting="true" ItemPlaceholderID="ProductsHolder">
                    <LayoutTemplate>
                            <asp:Panel ID="ProductsHolder" runat="server">
                            </asp:Panel>
                            <table>
                                <tr>
                                    <td>
                                        <telerik:RadDataPager RenderMode="Lightweight" ID="RadDataPager1" runat="server" PagedControlID="RadListView1"
                                            PageSize="6">
                                            <Fields>
                                                <telerik:RadDataPagerButtonField FieldType="FirstPrev"></telerik:RadDataPagerButtonField>
                                                <telerik:RadDataPagerButtonField FieldType="Numeric"></telerik:RadDataPagerButtonField>
                                                <telerik:RadDataPagerButtonField FieldType="NextLast"></telerik:RadDataPagerButtonField>
                                                <telerik:RadDataPagerPageSizeField PageSizeText="Page size: "></telerik:RadDataPagerPageSizeField>
                                                <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go"
                                                    TextBoxWidth="30"></telerik:RadDataPagerGoToPageField>
                                                <telerik:RadDataPagerTemplatePageField>
                                                    <PagerTemplate>
                                                        <div style="float: right; line-height: 34px; margin-left: 10px;">
                                                            Items
                                                        <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex+1%>"></asp:Label>
                                                            to
                                                        <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# Container.Owner.TotalRowCount > (Container.Owner.StartRowIndex+Container.Owner.PageSize) ? Container.Owner.StartRowIndex+Container.Owner.PageSize : Container.Owner.TotalRowCount %>"></asp:Label>
                                                            of
                                                        <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>"></asp:Label>
                                                            <br />
                                                        </div>
                                                    </PagerTemplate>
                                                </telerik:RadDataPagerTemplatePageField>
                                            </Fields>
                                        </telerik:RadDataPager>
                                    </td>
                                </tr>
                            </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                         <table>
                                <tr>
                                    <td style="width: 140px; text-align: left; height: 120px">
                                        <asp:Image ID="Img1" runat="server"
                                            ImageUrl='<%# Eval("_Image") %>' Height="100" Width="130" />
                                    </td>
                                    <td style="vertical-align: top; text-align: left">
                                        <asp:LinkButton runat="server" ID="Title" Font-Bold="true" CommandName="Select"
                                            Text='<%# Eval("_Title") %>'></asp:LinkButton>
                                        <asp:Label runat="server" ID="lblink" Font-Size="Small"
                                            Text='<%# Eval("_Link") %>' Visible="false" />
                                    </td>
                                </tr>
                            </table>
                    </ItemTemplate>
                </telerik:RadListView>  
            </asp:Panel>
          
            <asp:SqlDataSource ID="SqlDS" runat="server" ConnectionString="<%$ appSettings:sqlconn %>"
                ProviderName="System.Data.SqlClient" ></asp:SqlDataSource>

 

- aspx.cs work fine (don't use Button):

        protected void Page_Load(object sender, EventArgs e)
        {
            _News.NewsList("20", "", "08/20/2016", "08/30/2016", "0", "0", 0);
            RadListView1.DataSource = _News._znews;
            RadListView1.DataBind();
        }

- aspx.cs DataPager doesn't work:

        protected void Page_Load(object sender, EventArgs e)

         {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            _News.NewsList("20", "", "08/20/2016", "08/30/2016", "0", "0", 0);
            RadListView1.DataSource = _News._znews;
            RadListView1.DataBind();
        }

Thanks. 

Son
Top achievements
Rank 1
 answered on 06 Sep 2016
8 answers
440 views

Hi,

I've not got the data in my embedded tree via an ajax call and the tree is fully populated and expanded.  I have made it so that if teh drop down is a checkbox enabled on that the relevant nodes are ticked and if it isn't checkbox enabled that the relevant node is selected.

I now have a further 2 issues

1) I need to be able to make the unopened box show the checked/selected nodes.  On the server side there is a sync method but there seems to be nothing of the sort on the client side.  I have mucked around with beginUpdate and repaint etc but nothing seems to trigger a sync of the selection from the embedded tree back to the dropdown control.

2) I have the drop down set to autowidth but it doesn't work, it sticks on the width of the opening control box and as such I end up with both horizontal and vertical scrollbars.  This might be related to the issue in 1 if the box hasn't worked out that things are different.

Any suggestions?

By the way this is another area where there is significant improvement needed in the documentation.

Regards

Jon

Veselin Tsvetanov
Telerik team
 answered on 06 Sep 2016
1 answer
49 views

Hi,

I would like to add a piece of text to command item .How can i do it

 

Eyup
Telerik team
 answered on 06 Sep 2016
1 answer
89 views

Next issue - this one is very fustrating

My page works with some cascading combos and I have it all setup.  It works fine on the first load.  Then if I change one of the parent values the requestingitems event is raised and I alter the parameters as before of teh client data source but this time nothing happens.  There is no http request (I see them on the initial call via fiddler) 

This is my code that adds the custom parameters on the fly onto the datasource.  

$find(dataSourceId).get_dataSourceObject().options.transport.read.url = $find(dataSourceId).get_dataSourceObject().options.transport.baseUrl + dataSourceUrl;

Any suggestions?

Regards

Jon

Ivan Danchev
Telerik team
 answered on 06 Sep 2016
1 answer
78 views

Hi,

I'm not having much luck with things recently.  Everything I seem to be wanting to do comes out as a battle with work arounds galore.  Anyway the latest issue that hopefully someone can advise me on is that my combos are driven by a RadClientDataSource and I am having issues getting the value of checked items on the server.

OK so I get that the items that were checked won't be available on a post back however surely it would be sensible that the combo retains the checked item ids or the selected item id on post back? Actually it does if you are not using checkboxes.  So why does the control have the functionality to remember what the selected value was but not the checked values?

It appears that over the years quite a few people have had this issue and so far I can see that the solution is to add a hidden field then every change save the current checked values and finally get that when back on the server.  Not great.

Hopefully I am completely wrong and there is a nice easy way to do this.  If not please please please make this an addition to the next version.  It isn't difficult to add it to the base control and would be a seriously helpful addition.

Regards

Jon

Ivan Danchev
Telerik team
 answered on 06 Sep 2016
15 answers
934 views
Hi,
    I am looking for help with RadGrid Batch Editing. I have developed a solution that works fine as far as inputting data and saving to the DB goes but doesn't handle validation very well at all. I'm sure there are likely to be some good examples of what I would like to do but my searches fail to turn up anything, mainly because of the multitude of related articles.

Currently, I have cell validation for those cells that need it but not row validation. There are some cells that are either mutually exclusive or inclusive, so I would like to do a validation check on these. At the moment I just discard invalid rows, which isn't very helpful to the poor user. My two problems are:

1) I cannot see a way to preserve invalid rows on the grid after postback.

2) I can create a list of validation errors but cannot figure out how to display these to the user. Everything I have tried executes OK but doesn't show up in either a label or popup message after postback.

Below is a list of options, a solution for any one of these would be sufficient for me. My favourite solution is at the top but any one is acceptable.

1) When the user presses the "Save Changes" button, check all rows and flag up the ones with validation problems. The whole grid remains as it was when the user pressed the "Save Changes" button (i.e. with all the edits stall flagged and outstanding).

2) When the user presses the "Save Changes" button, each row is checked and saved if OK. The remainder are flagged up as having validation problems, which the user can then address and re-save once sorted.

3) Discard the invalid rows as I am currently doing but notify the user via a popup message once the postback has completed.I would be grateful for any help
with this problem.

Regards

Geoff
Eyup
Telerik team
 answered on 06 Sep 2016
1 answer
1.1K+ views

Hi, 

I trying to do a rest of DropDownList whenever my RadTabStrip is changing. I have try using Items.Clear() when there a TabSwitch Event occur. however, is not wroking.The Item in DropdownList is blinded with Datasource, try setting DataSource as Null is not working too.

Can someone advise my an alternative solution? 

Ivan Danchev
Telerik team
 answered on 06 Sep 2016
1 answer
175 views

Hi,

I have encountered the issue of RadDatePicker showing transparent on background when clicked on it. Please advise how to overcome this issue. I have included the screen shot.

Telerik.Web.UI version: v2.0.50727

ASP UI page:

  <telerik:RadDatePicker ID="rdpActivityDate"  RenderMode="Lightweight" runat="server"  > </telerik:RadDatePicker>

Eyup
Telerik team
 answered on 06 Sep 2016
3 answers
1.1K+ views
What will be the differences in the generated "new project" between selecting "RadControls VB.NET Web Application" and "RadControls VB.NET WebSite" in the "Create New Telerik Project" dialog box?

Thanks,

Donald
Nuttapol
Top achievements
Rank 1
 answered on 06 Sep 2016
1 answer
267 views

Please bear with me, as this is my first post.

I am trying to do a clientside validation on filename expression. I do not want to have :, /, %, etc in my file names. How do you guys do that?

Ivan Danchev
Telerik team
 answered on 05 Sep 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?