Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
144 views
I am trying to modify the filter menus on the grid at runtime using an example directly from your onlne manual, but the Grid_Init event code in the server is not firing.

Can anyone tell me what I am doing wrong?

Here's the actual grid definition from the .aspx:

<telerik:RadGrid AutoGenerateColumns="false" ID="QualContsGrid" runat="server" Width="800px" OnItemCommand="QualContsGrid_ItemCommand"
    Height="430px" On
    AllowSorting="true" AllowFilteringByColumn="true" EnableLinqExpressions="true"
    OnItemDataBound="QualContsGrid_ItemDataBound"
    AllowPaging="true" PageSize="15"
    BorderWidth="1px" BorderColor="#999999" EnableEmbeddedSkins="true" Skin="Default"
    DataSourceID="SQLDataSource1"
    ShowFooter="True" GridLines="None" >
    <StatusBarSettings ReadyText="Ready" LoadingText="Loading..." />
    <MasterTableView >
        <Columns>
            <telerik:GridBoundColumn HeaderStyle-Width="125px" UniqueName="VoterFirstName" HeaderText="First Name" DataField="FirstName" SortExpression="FirstName" >
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderStyle-Width="125px" UniqueName="VoterLastName" HeaderText="Last Name" DataField="LastName" SortExpression="LastName" >
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderStyle-Width="300px" UniqueName="VoterAddress" HeaderText="Address" DataField="Address" SortExpression="Address" >
            </telerik:GridBoundColumn >
            <telerik:GridButtonColumn DataTextFormatString="Remove" ButtonType="PushButton" UniqueName="RemoveContribution" HeaderStyle-Width="75px"
                ConfirmText="Are you certain that you want to remove this contribution?"  Text="Remove"
                HeaderText="Remove" CommandName="RemoveContribution" CommandArgument="VoterQualifyingContributionId" DataTextField="VoterQualifyingContributionId" >
            </telerik:GridButtonColumn>
            <telerik:GridBoundColumn HeaderStyle-Width="125px" UniqueName="ContributionStatus" HeaderText="Status" DataField="PaymentDescription" SortExpression="PaymentDescription" >
            </telerik:GridBoundColumn >
            <telerik:GridBoundColumn UniqueName="VoterQualifyingContributionId" HeaderText="" DataField="VoterQualifyingContributionId" Visible="false" >
            </telerik:GridBoundColumn >
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    </ClientSettings>
</telerik:RadGrid>

The code behind contains:

protected void QualContsGrid_Init(object sender, System.EventArgs e)
{
    GridFilterMenu menu = QualContsGrid.FilterMenu;
    int i = 0;
    string a = "";
    while (i < menu.Items.Count)
    {
 
        a = menu.Items[i].Text;
 
        if (menu.Items[i].Text == "NoFilter" || menu.Items[i].Text == "Contains" || menu.Items[i].Text == "StartsWith" || menu.Items[i].Text == "EqualTo")
        {
            i++;
        }
        else
        {
            menu.Items.RemoveAt(i);
        }
    }
}

The only reason the line of code "a = menu.Items[i].Text;" is in there is that I had a debug stop placed on it (and it never executed).  I also had a debug stop on the very first line in this event's code and it never fired.

On code/debug stops in Page_Init and Page_Load did fire correctly.

Also, code (and the debug stop) in the "QualContsGrid_AjaxRequest" DID execute correctly.

How do I get the RadGrid_Init event code to fire?

Thanks in advance!

Lynn

Shinu
Top achievements
Rank 2
 answered on 06 Jan 2012
1 answer
180 views
Hello

I want to change modal window size dynamically.
So I using setSize client method. But it does not work. Is there something wrong with my code?
Here is my javascript code.
function RadButtonNew_OnClientClicked() {
    var oManager = GetRadWindowManager();
    var windowClientID = "RadWindowTest";
    var oWnd = oManager.getWindowById(windowClientID);
 
    oWnd.setUrl("./Test.aspx");
    oWnd.set_title("New");
    oWnd.set_reloadOnShow(true);
 
    oWnd.show();
    var popupWidth = $telerik.$(window).width() * 0.8;
    var popupHeight = $telerik.$(window).height() * 0.8;
 
    oWnd.setSize(popupWidth, popupHeight);
    oWnd.center();
     
    return false;
}

aspx
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" AutoSize="false"
            Modal="false" VisibleTitlebar="true" Width="600" Height="400" MinWidth="600" MinHeight="400" Behaviors="Close, Move, Resize"
            VisibleStatusbar="false" Skin="Default" ShowContentDuringLoad="false" ReloadOnShow="false"
            Style="position: absolute; z-index: 7000;" RestrictionZoneID="RadPaneContents"
            OnClientBeforeClose="RadWindowManager1_OnClientBeforeClose" OnClientClose="RadWindowManager1_OnClientClose"
            OnClientShow="RadWindowManager1_OnClientShow" OnClientDragEnd="ResizeSplitterWrap">
            <Windows>
                <telerik:RadWindow ID="RadWindowTest" runat="server" />
            </Windows>
        </telerik:RadWindowManager>


I did set AutoSize="true" but it does not work too.
In some case, even when I did set number not percentage, it does not work too.
For example, setSize(1250, 700)
set_width and SetWidth do not work too.
I really don't know why it does not work.
What is the problem?

Hee
Princy
Top achievements
Rank 2
 answered on 06 Jan 2012
1 answer
46 views
Hi,

Is it possible to display multiple web pages (aspx) inside the radgrid control and then export the radgrid into a pdf?

Regards.
Shinu
Top achievements
Rank 2
 answered on 06 Jan 2012
1 answer
118 views
I have radgrid with itemplate for every column like below
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="Vertical" Skin="Hay" PageSize="250"
      AllowSorting="True" AllowPaging="True" ShowGroupPanel="False" AutoGenerateColumns="false"
      Width="100%" >
      <PagerStyle Mode="Slider"></PagerStyle>
      <MasterTableView ShowGroupFooter="true" GroupsDefaultExpanded="False" HeaderStyle-HorizontalAlign="Center"
          GroupHeaderItemStyle-BackColor="white" GroupHeaderItemStyle-ForeColor="Black"
          GroupHeaderItemStyle-Font-Size="Medium" DataKeyNames="SkillID">
          <GroupByExpressions>
              <telerik:GridGroupByExpression>
                  <SelectFields>
                      <telerik:GridGroupByField FieldName="SkillAreaId" HeaderText=" " />
                      <telerik:GridGroupByField FieldName="SkillArea" HeaderText=" " />
                  </SelectFields>
                  <GroupByFields>
                      <telerik:GridGroupByField FieldName="SkillAreaId" HeaderText="" HeaderValueSeparator=" " />
                  </GroupByFields>
              </telerik:GridGroupByExpression>
          </GroupByExpressions>
          <Columns>
              <telerik:GridTemplateColumn  UniqueName="SkillID">
                  <ItemTemplate>
                      <b>
                          <%# Eval("SkillID")%>
                      </b>
                  </ItemTemplate>
                  <FooterTemplate>
                  </FooterTemplate>
              </telerik:GridTemplateColumn>
              <telerik:GridTemplateColumn>
                  <ItemTemplate>
                      <%# Eval("Skill")%>
                  </ItemTemplate>
              </telerik:GridTemplateColumn>
              <telerik:GridTemplateColumn>
                  <HeaderTemplate>
                      None<br />
                      0</HeaderTemplate>
                  <ItemTemplate>
                      <asp:RadioButton ID="RadioButton1" runat="server" /></ItemTemplate>
              </telerik:GridTemplateColumn>
              <telerik:GridTemplateColumn>
                  <HeaderTemplate>
                      Basic<br />
                      1</HeaderTemplate>
                  <ItemTemplate>
                      <asp:RadioButton ID="RadioButton2" runat="server" /></ItemTemplate>
              </telerik:GridTemplateColumn>

I  been trying to access each column in the grid to add a link button for each row with the same event attached to all the link button. But I am stuck at even getting the column value or adding link button to the column. I tried below,

Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid1.ItemDataBound
 
If TypeOf e.Item Is GridDataItem Then
            Dim itm As GridDataItem = CType(e.Item, GridDataItem)
 itm("SkillId").Controls.Add(New LiteralControl("test"))
End If


But nothing works. I just simply want to get the value of the column first and embed a link button to the column and trigger a common event. Help me out. 
Shinu
Top achievements
Rank 2
 answered on 06 Jan 2012
1 answer
47 views
Hi Everyone,

When I select a different value in a combobox after exporting a grid (export process is a custom fonction using RadGrid1.MasterTableView.ExportToCSV();) We end up with this error: "
Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request."

Is it normal? Is there a way to refresh/rebind the gris after creating the export?

Thank you

Regis

regis
Top achievements
Rank 1
 answered on 05 Jan 2012
1 answer
137 views
My RadListBox displays correctly in Firefox and Chrome but in Internet Explorer it's not showing up and the styles are not being applied. I can still drag and drop items between listbox's, so the control still seems to have some function. 

From what I've looked at using the IE Web Developer Toolbar it would seem that the styles for RadListBox are not being applied at all in IE. Which is odd because they are being applied in Firefox and Chrome. 

See the attached images for an example. 
William
Top achievements
Rank 1
 answered on 05 Jan 2012
16 answers
377 views
Hi, I drop a RadioButtonList and set its default select index to 0. In normal postback (with RadAjaxManager) mechanism, everything goes well. But if I use RadAjaxManager to instruct it to upload another Control, selecting the first option will not fire postback, while selecting others goes normally. The code snippet is as follows:

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="TimeOption_RadioList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Chart1" />
                </UpdatedControls>
            </telerik:AjaxSetting>

 <asp:Panel ID="filterRadio_Panel" runat="server"  DefaultButton="filterSubmit_Btn">
     <asp:RadioButtonList ID="TimeOption_RadioList" runat="server" RepeatDirection="Horizontal"
     OnSelectedIndexChanged="TimeOption_RadioList_SelectedIndexChanged"
     AutoPostBack="True" DataSource='<%#getTimeOptions() %>' DataTextField="key" DataValueField="value" OnDataBound="TimeOption_RadioList_DataBound" >

     </asp:RadioButtonList>
 </asp:Panel>


Is this a common bug?

Regards,
Ricky.
Doug Beard
Top achievements
Rank 1
 answered on 05 Jan 2012
7 answers
101 views
We've been using Telerik Rad controls for a year now, and I always upgrade to the latest cut.

As of the recent Q2 2011 all upgrades we have done are conplaining  they keep getting "A script on this page is causing Internet Explorer to run slowly" error, this is on a busy grid with only about 300 records, the problems go away if the records don't exceed about 30.

Have you seen this from other users?

We have clients on a mix of iis6 & 7 and IE 6,7 & 8.

We are having to stop the upgrade rollout until we get this resolved.

I have tried many things from disabling the viewstate to extending the MaxScriptStatements to 10,000,000.

Andy

PS - just seen the same error on my development system running ie9 and 290 records.
PPS - If I remove the RadAjaxManager I stop getting the error, so its an AJAX thing.


Andy Green
Top achievements
Rank 2
 answered on 05 Jan 2012
0 answers
123 views

I have my global.asax file setup to report all errors to me via email. I keep getting the following error popup up 10 - 15 times a day on our BETA site (we are still on trial)

This is the exact error: The file '/QSSWeb2_Test/MySkins/Sigma/ImageHandler.ashx' does not exist.

We use custom skins. Any help would be appreciated.

Here's the full stack.

System.Web.HttpException (0x80004005): The file '/QSSWeb2_Test/MySkins/Sigma/ImageHandler.ashx' does not exist.

   at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)

   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)

   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)

   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)

   at System.Web.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)

   at System.Web.UI.SimpleHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)

   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)mode = get suite = aspnet-ajax control = ComboBox skin = Sigma file = calendar-top.jpg t = 1807901079 QSSWeb_UserName = UserName=jdoe ASP.NET_SessionId = 0ecjcaarg0odk355fdj1jxqe ASPXAUTH =

Gerry
Top achievements
Rank 1
 asked on 05 Jan 2012
1 answer
347 views
I am working with a grid that I am using an ItemTemplate for the MasterTableView.  In addition to the ItemTemplate I have three GridButtonColumns.  When the user clicks one of these buttons, I want to get the Index of the record for that row (In my case the Unique Name is: AssetIdx).  

Without the ItemTemplate the following code works fine:

GridDataItem item;
String ArticleID;
 
item = e.Item as GridDataItem;
ArticleID = item["AssetIdx"].Text;


With the ItemTemplate the code does not work.

I saw the following note in the demos (http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/cardview/defaultcs.aspx) :

"When you set item template all GridDataItems/GridEditableColumns (auto-generated or declarative) will be replaced with a single cell which will be used as a container for the templated content."

I have looked everywhere, and I can't find an example to get the value when the grid is treated as a single cell.

Can someone point me in the correct direction.  Thanks!
TazDeveloper
Top achievements
Rank 1
 answered on 05 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?