Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
581 views
The function is returning no items. Following is a copy of my markup and code:

protected void Page_Load(object sender, EventArgs e)
{
    RadGrid1.DataSource = GetDataSource();
    RadGrid1.DataBind();
}
 
private DataTable GetDataSource()
{
    ...
}
 
private void AddGroupHeadersToGrid()
{
    GridItem[] header = RadGrid1.MasterTableView.GetItems(GridItemType.Header);
    //GridTHead head = ((GridTHead)header[0].Parent.Controls[0].Parent);
 
    GridHeaderItem newHeaderItem = new GridHeaderItem(RadGrid1.MasterTableView, 0, 0);
    newHeaderItem.Cells.Add(new GridTableHeaderCell());
    newHeaderItem.Cells[0].Text = "I'm a header.";
 
    //head.Controls.AddAt(0, newHeaderItem);
}
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    AddGroupHeadersToGrid();
}

The markup looks like this:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false"
    onprerender="RadGrid1_PreRender">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn HeaderText="Question" DataField="Question" UniqueName="Question">
            </telerik:GridBoundColumn>
             
            <telerik:GridBoundColumn HeaderText="Score" DataField="MTDScore" UniqueName="MTDScore">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Area" DataField="MTDArea" UniqueName="MTDArea">
             
            <telerik:GridBoundColumn HeaderText="Score" DataField="QTDScore" UniqueName="QTDScore">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Area" DataField="QTDArea" UniqueName="QTDArea">
             
            <telerik:GridBoundColumn HeaderText="Score" DataField="YTDScore" UniqueName="YTDScore">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Area" DataField="YTDArea" UniqueName="YTDArea">
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

I would really appreciate if somebody can tell me what I'm doing wrong here!
Princy
Top achievements
Rank 2
 answered on 15 Oct 2013
10 answers
441 views
Hi,

I am trying to reference a radTextBox through javascript to capitalize its value on blur and keypress event.
However, $find(client-Side-Object-Name) returns null in IE whereas it works fine in firefox (3.5.5).

The version of our telerik is 2008.3.1314.35

<telerik:RadScriptBlock ID="radScriptBlock" runat="server"
    <script type="text/javascript"
 
        AddPageLoadHandler(function() 
        { 
            AutoCapitaliseFirstChar('<%= FirstNameTextBox.ClientID %>'); 
        }); 
         
    </script> 
    </telerik:RadScriptBlock> 
function AddPageLoadHandler(fn) 
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(fn); 
// not created dynamically 
<telerik:RadTextBox runat="server" ID="FirstNameTextBox" /> 
// These client-side functions auto-capitalises text in RadTextBox as user enters it 
// The conversion is done after a short timeout to avoid interfering with normal onfocus behaviour 
function AutoCapitaliseFirstChar(radTextBoxClientId) { 
 
    var radTextBoxClientObject = $find(radTextBoxClientId); 
    // here radTextBoxClientObject is null for IE but not for firefox 
    // so it works fine with firefox not with IE 8 
 
    // This converts the text when field loses focus 
    $(radTextBoxClientObject.get_element()).blur(function() { 
        setTimeout(function() { 
            var val = radTextBoxClientObject.get_value(); 
            radTextBoxClientObject.set_value(val.substring(0, 1).toUpperCase() + val.substring(1)) 
        }, 200); 
    }); 
 
    // Except in Safari, convert the text as it is typed 
    // (in Safari this is incompatible with the field autocomplete behaviour) 
    if (!$.browser.safari) { 
        $(radTextBoxClientObject._textBoxElement).keypress(function() { 
            setTimeout(function() { 
                var val = $(radTextBoxClientObject._textBoxElement).val(); 
                radTextBoxClientObject.set_value(val.substring(0, 1).toUpperCase() + val.substring(1)) 
            }, 200); 
        }); 
    } 
Any ideas would be appreciated,

regards,

Toby


Ganesh
Top achievements
Rank 1
 answered on 15 Oct 2013
1 answer
190 views
Hi

I'm trying to use the following in particular the JavaScript option: http://www.telerik.com/help/aspnet/window/openwindowfrommenu.html

The pop up isn't opening, I know I'm hitting the function but I get the following error - unable to get property 'Text of undefined or null reference' on the line

eventArgs.Item.Text

Any Ideas.

Andy

 

Kate
Telerik team
 answered on 14 Oct 2013
3 answers
244 views
For consideration in a future release the RadDataPager should allow registration to an OnPageSizeChanged event. I am handling the databinding and paging in code behind going through a WCF tier; however, I had to remove the change PageSize functionality from the end user because this event doesn't exist.

The Functionality should be like this to mirror the PageIndexChanged event:

ASPX:

                <telerik:RadDataPager ID="RadDataPager1" runat="server" OnPageIndexChanged="RadDataPager1_PageIndexChanged"
                    OnTotalRowCountRequest="RadDataPager1_TotalRowCountRequest"
    OnPageSizeChanged="RadDataPager1_PageSizeChanged" Skin="Windows7">
                   ...
                </telerik:RadDataPager>

Code Behind:

    protected void RadDataPager1_PageSizeChanged(object sender, RadDataPagerPageSizeChangeEventArgs e)
    {
        int NewPageSize = e.NewPageSize;
...
    }

Cheers,
Andrew.


   
Michael
Top achievements
Rank 1
 answered on 14 Oct 2013
3 answers
124 views
Hi,

I have a RadTabStrip linked with a RadMultiPage.

ASPX:
<telerik:RadTabStrip ID="tsConfig" runat="server" MultiPageID="mpConfig" SelectedIndex="0"
        Width="100%" Skin="Office2010Silver" OnClientTabSelecting="OnTabSelecting_CheckPageView">
        <Tabs>
            <telerik:RadTab Text="Tab 1" PageViewID="rpvGeneral" Width="150px">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 2" PageViewID="rpvPhoto">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 3" PageViewID="rpvListePatients">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 4" PageViewID="rpvListesPrescriptions">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 5" PageViewID="rpvPrescripteur">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="mpConfig" runat="server" SelectedIndex="0" Width="100%"
        BackColor="White" Height="500px" BorderColor="Silver" Style="overflow: hidden;">
        <telerik:RadPageView runat="server" ID="rpvGeneral">
            <cgsi:ConfigGeneral runat="server" ID="ucConfigGeneral" />
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvPhoto" Visible="false">
            <cgsi:ConfigPhoto runat="server" ID="ucConfigPhoto" />
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvListePatients" Visible="false">
            <cgsi:ConfigListePatients runat="server" ID="ucConfigListePatients" />
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvListesPrescriptions" Visible="false">
            <cgsi:ConfigListesPrescriptions runat="server" ID="ucConfigListesPrescriptions" />
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvPrescripteur" Visible="false">
            <cgsi:ConfigPrescripteur runat="server" ID="ucConfigPrescripteur" />
        </telerik:RadPageView>
    </telerik:RadMultiPage>

VB:
Private Sub tsConfig_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles tsConfig.TabClick
        e.Tab.PageView.Visible = True
    End Sub

My problem is that in the ascx named "ucConfigPrescripteur" I have a RadComboBox that I set the width to 160px. But for some reason, on the page, the combobox is set to 260px until I do a postback it will set it to 160px.

This is only happenning with RadMultiPage.

Thanks.
Kate
Telerik team
 answered on 14 Oct 2013
1 answer
137 views
Hello,

Is there a way to have events, such as RadDatePicker.ClientEvents.OnDateSelected or RadListBox.OnClientSelectedIndexChanged, handle functions with arguments, apart from "sender" and "eventArgs"?
The following code doesn't do it completely right:

RadListBox rlb = new RadListBox();
rlb.OnClientSelectedIndexChanged = "ToSomething('Aaa', 'Bbb', 'Ccc')";
function DoSomething(a, b, c)
{
   //code
}

Thanks in advance.
Laurens
Top achievements
Rank 1
 answered on 14 Oct 2013
13 answers
234 views
Hello,

How would i be able to switch from using regular text boxes which uses
boundColumn = new GridBoundColumn();

When creating a radgrid dynamically to using Radautocomplete text boxes?

Brad
Top achievements
Rank 1
 answered on 14 Oct 2013
3 answers
119 views
Hi Friends,
I'm new to telerik code
Can you please tell me how to modify tool tip  instead of "Go to root " i want to change it to "Go to Top" ? Can you please suggest me.

 Thanks,

Peter Filipov
Telerik team
 answered on 14 Oct 2013
1 answer
101 views

Below is my code, all of it.  When I click the button, the RadAlert only appears for an instant. Why?

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm10.aspx.vb" Inherits="Easiest_Way.WebForm10" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server" />
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
        <div>
            <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton" OnClientClicked="ClientClicked" />
        </div>
    </form>
</body>
<script type="text/javascript">
    function ClientClicked(sender, e) {
        radalert("Hi!");
        return false;
    }
</script>
</html>

 

Marin Bratanov
Telerik team
 answered on 14 Oct 2013
1 answer
196 views
Is it possible to put an entire radgrid within modalpopupextender? If so, does anyone have a simple example on how to do this?
Konstantin Dikov
Telerik team
 answered on 14 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?