Question

I want to chance CurrentPageText text property by using c# code. i am using

<telerik:RadDataPager ID="RadDataPager3" runat="server" PagedControlID="RadListView1"
                                            PageSize="9" Skin="">
                                            <Fields>
                                                <telerik:RadDataPagerGoToPageField CurrentPageText="Page:"
                                                    TotalPageText="of" SubmitButtonText="Go" TextBoxWidth="15" />
                                            </Fields>
                                        </telerik:RadDataPager>

code and now i want to change text of CurrentPageText, TotalPageText and SubmitButtonText by using C# code.

It can be feasible or not?

Thanks...

Was it helpful?

Solution

ell in this case you run into a unique sort of problem. The "Fields" located within the RadDataPager do not seem to have any ID to them, meaning you cannot reference them directly. You can, however, still modify their properties, but must be creative when doing so, because you must use code that may have unwanted affects on your controls:

If you are only using one "RadDataPagerGoToPageField" you may do something such as:

foreach (RadDataPagerGoToPageField thevar in RadDataPager3.Fields)
{
    thevar.CurrentPageText = "New Text";
    thevar.TotalPageText = "New Text2";
    thevar.SubmitButtonText = "New Text3";
}

Or if you need to get picky, you can add conditionals (if statements) to check the current properties of a given "RadDataPagerGoToPageField" and modify accordingly.

if(thevar.CurrentPageText == "Some sort of unique value")
{
   thevar.CurrentPageText == "Something new"
}

I'm sure you get the idea.

Hope that helps.

-J

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top