Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
141 views
I have got a button on the grid that when clicked sets a viewstate item to a file.
Now when i try use the response it gives me a error.
Now i have seen you can do it by
RadAjaxPanel1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", http://yoursite.com/Your_File));

But how would one use this to do

response.binarywrite(byte[])

Please any help will be much appreciated. If this is in the incorrect section plese relocate.
Thanks
Veli
Telerik team
 answered on 03 May 2010
1 answer
633 views
Hi,

I have a webpage with the following controls and javascript function

 function closeWin(args)
{
  radalert("Hello world", "350", "150", "alert");
}



<telerik:RadAjaxPanel ID="UpdatePanel1" runat="server">

<asp:LinkButton ID="btnOK" runat="server" OnClientClick="javascript:closeWin(0);"><span>OK</span></asp:LinkButton>
<asp:LinkButton ID="btnCancel" runat="server" href="javascript:closeWin(-1);" ><span>Cancel</span></asp:LinkButton>

</telerik:RadAjaxPanel>

given the above code, i want to display alert using radalert, how to do it, please note i dont want to use server side code for registering the javascript function

Thanks,


Shinu
Top achievements
Rank 2
 answered on 03 May 2010
1 answer
70 views
I've implemented the Load On Demand for the RadTabStrip & RadMultiPage and followed the sample show in http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/loadondemand/defaultcs.aspx . My Second and Third tabs load user controls in them.

This working fine with the Q3 2009 Trial Version, but when I purchased the Q1 2010 Developer Version, this stopped working and I receive and error "Two components with the same id 'mpageMain' can't be added to the application".

Here is my ASPX
<%@ Page   
    Language="C#"   
    AutoEventWireup="true"   
    CodeBehind="OnDemandLoad.aspx.cs"   
    Inherits="Telerik.OnDemandLoad" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head> 
    <title>On Demand Load</title> 
</head> 
<body> 
    <form id="frmOnDemandLoad" runat="server">  
    <asp:ScriptManager ID="smgrMain" runat="server" /> 
      
    <telerik:RadTabStrip  
        ID="tsMain" 
        runat="server" 
        Align="Left" 
        SelectedIndex="0" 
        MultiPageID="mpageMain" 
        OnClientTabSelecting="tsMain_ClientTabSelecting" 
        OnTabClick="tsMain_TabClick" > 
        <Tabs> 
            <telerik:RadTab Text="Alpha" PageViewID="pvAlpha" /> 
            <telerik:RadTab Text="Beta" PageViewID="Beta"/>  
            <telerik:RadTab Text="Gama" PageViewID="Gama"/>  
        </Tabs> 
    </telerik:RadTabStrip> 
      
    <telerik:RadMultiPage   
        ID="mpageMain"   
        runat="server"   
        SelectedIndex="0" 
        OnPageViewCreated="mpageMain_PageViewCreated" 
        ScrollBars="None" 
        BorderWidth="1px">  
        <telerik:RadPageView ID="pvAlpha" runat="server">Alpha</telerik:RadPageView> 
    </telerik:RadMultiPage> 
      
    <telerik:RadAjaxManager ID="amgrMain" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="tsMain">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="tsMain" /> 
                    <telerik:AjaxUpdatedControl ControlID="mpageMain" LoadingPanelID="alpDefault" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="mpageMain">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="mpageMain" LoadingPanelID="alpDefault" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings>   
    </telerik:RadAjaxManager> 
      
    <telerik:RadAjaxLoadingPanel ID="alpDefault" runat="server" /> 
    <telerik:RadScriptBlock ID="rcbMain" runat="server">  
      
        <script language="javascript" type="text/javascript">  
            function tsMain_ClientTabSelecting(sender, args)    
            {    
                if (args.get_tab().get_pageView())    
                {    
                    if(args.get_tab().get_pageView().get_id())    
                    {    
                        args.get_tab().set_postBack(false);    
                    }    
                }    
            }    
        </script> 
    </telerik:RadScriptBlock> 
    </form> 
</body> 
</html> 
 

And my code behind
        private void AddPageView(string pageViewID)  
        {  
            RadPageView pageView = new RadPageView();  
            pageView.ID = pageViewID;  
            mpageMain.PageViews.Add(pageView);  
        }  
 
        protected void tsMain_TabClick(object sender, RadTabStripEventArgs e)  
        {  
            AddPageView(e.Tab.Text);  
            if (e.Tab.PageView == null)  
            {  
                e.Tab.PageViewID = e.Tab.Text;  
            }  
            e.Tab.PageView.Height = Unit.Pixel(e.Tab.Index * 100); 
            e.Tab.PageView.Selected = true;  
        }  
 
        protected void mpageMain_PageViewCreated(object sender, RadMultiPageEventArgs e)  
        {  
            // Load the User Control  
 
            //string strUserControl = "~/UserControls/" + e.PageView.ID + ".ascx";  
            //Control objControl = Page.LoadControl(strUserControl);  
            //objControl.ID = e.PageView.ID + "_userControl";  
            //e.PageView.Controls.Add(objControl);  
        } 

I can no longer use Q3 2009 as it has the Grid's OnCommand Client Event problem.

Is there anything different to be done for the Q1 2010 version?
Yana
Telerik team
 answered on 03 May 2010
1 answer
241 views
We have a control having a Radgrid. Dataset is provided to this grid from page. In some scenario, we are not able to provide dataset to the grid. In that case we are getting follwoing error:
this.ColGroup.Cols is null or not an object.
This error also occurs when there are no columns in the datasource.

In case when Datasource is null we have set it to:

wgEntityList.DataSource =

new Object[0];

 


But still we are facing this issue.

Also we are not able to place this control multiple times on our page because one page can not have multiple RadAjaxManagers.
Please help in this regard.

Thanks,
Sushma

Nikolay Rusev
Telerik team
 answered on 03 May 2010
1 answer
162 views
Hi,

I want to freeze some columns from left side in the radgrid and navigate to other columns using a horizantal scroll bar , how to do it ?

i'm also using GridClientSelectColumn column in the grid

kindly provide some solution

Regards,

Princy
Top achievements
Rank 2
 answered on 03 May 2010
2 answers
163 views
Hello,

I need to check if a cell that the user is editing (cell in edit mode) does not exist in the rest of the radgrid (for the same column).
Since radgrid1.Items retrieves just the items of the current page, I tried to disable paging and filtering for a while in the validation method raised by the OnServerValidate event.
That's ok, but rebinding creates some problems for me.
Take as example that the user inserts a value duplicated.
The OnServerValidate event occurs twice in sequence (I don't know why) and the second time it is raised the cell changed by the user has the original text before editing (in fact we did a rebind!) and my validation method evaluates that everything is ok and generates no error message and no change in the DB. The expected behaviour was that the user receives a message error: "Duplicate value".

Could you help me?
Is there a way to disable paging and filtering without rebinding the grid, but just refreshing the interface?

Following is the code.

Thanks in advance.

    Public Sub ValidateDescriptionDuplicates(ByVal source As Object, ByVal args As ServerValidateEventArgs)  
        Dim desc As String 
        Dim id As String 
 
        Dim tb As New TextBox()  
        Dim hi As New System.Web.UI.HtmlControls.HtmlInputHidden()  
        Dim dvt As DataView  
        Dim dvr As DataRowView  
        Dim err As Integer 
        Dim e As DataGridItem  
        Dim dgi As GridDataItem  
 
        If Page.IsValid Then 
            dgi = Me.RadGrid1.EditItems(0)  
 
            Dim t As New Translate()  
 
            desc = MyRadUtility.GetControlValue(dgi, "textbox")  
            id = MyRadUtility.GetGridValue(dgi, "ID")  
            err = 0  
              
            RadGrid1.AllowPaging = False 
            Dim filterExp As String = RadGrid1.MasterTableView.FilterExpression  
            RadGrid1.AllowFilteringByColumn = False 
            RadGrid1.Rebind()  
 
            For Each dgiTemp As GridDataItem In RadGrid1.Items  
                If desc = GetControlValue  
dgiTemp, "label") And Not dgiTemp.GetDataKeyValue("ID") = id Then 
                    If Not Me.Customvalidator2 Is Nothing Then 
                        Me.Customvalidator2.Text = t.TranslateString("Attention! Description already inserted!")  
                    End If 
                    err = err + 1  
                End If 
            Next 
 
            RadGrid1.AllowPaging = True 
            RadGrid1.AllowFilteringByColumn = True 
            RadGrid1.MasterTableView.FilterExpression = filterExp  
            RadGrid1.Rebind()  
              
            If err = 0 Then 
                args.IsValid = True 
            Else 
                args.IsValid = False 
            End If 
        Else 
            args.IsValid = True 
        End If 
    End Sub 
saggiatorius
Top achievements
Rank 1
 answered on 03 May 2010
7 answers
176 views
Hi I'm using 2010Q1 library.
I'm trying to use following approach to validate input values:

<asp:TextBox runat="server" ID="MessageText" TextMode="MultiLine" ValidationGroup="Contact" /> 
<asp:LinkButton ID="SendBtn" ValidationGroup="Contact" runat="server" Text="Send" /> 
<telerik:RadInputManager  ID="ContactRadInputManager" runat="server"> 
    <telerik:TextBoxSetting BehaviorID="MessageBehavior" EmptyMessage="Message" ErrorMessage="Please enter message" 
                            Validation-IsRequired="true" Validation-ValidationGroup="Contact"> 
        <TargetControls> 
            <telerik:TargetInput ControlID="MessageText" /> 
        </TargetControls> 
    </telerik:TextBoxSetting>     
</telerik:RadInputManager> 

During initial page load MessageText control shows EmptyMessage as expected. Then (don't enter text box) click SendBtn button text box. Text box shows error message as expected. After that if I focus to text box it shows EmptyMessage instead of blank field. And any uses' input is appended to EmptyMessage (see attached pics).
Please let me know what I'm doing wrong or provide some workaround if this issue.

Thank you.
Pavel
Telerik team
 answered on 03 May 2010
1 answer
111 views
I am trying to create a checkbox list in a radgrid.  I get it to populate, but the problem I am having is updating the field in the database as well as checking the values of the fields of the column in the db table to set the boxes to be checked when the edit button is clicked.  Any suggestions?
Shinu
Top achievements
Rank 2
 answered on 03 May 2010
1 answer
150 views
Hello I have a RadListBox with ItemTemplates which have image button inside, how can I pick the event when the button is clicked as I see RadListBox has no OnItemCommand event.
In my case I put custom delete button inside ItemTemplate like this
<telerik:RadListBox ID="listboxAddresses" Height="158" Width="200" runat="server"> 
                <ItemTemplate> 
                    <div class="ListBoxItem"> 
                        <table width="130"> 
                            <tr> 
                                <td> 
                                    <asp:Label ID="lblCity" runat="server"></asp:Label> 
                                    <br /> 
                                    <asp:Label ID="lblAddress"  runat="server"></asp:Label> 
                                </td> 
                                <td align="right" width="15"> 
                                    <asp:ImageButton ID="btnDelete" CommandName="Delete" ImageUrl="~/Images/icons/delete.png" runat="server" /> 
                                </td> 
                            </tr> 
                        </table> 
                    </div> 
                </ItemTemplate> 
</telerik:RadListBox> 


Princy
Top achievements
Rank 2
 answered on 03 May 2010
6 answers
146 views
Hi,

I am using Telerik radgrid in my application and i am unable to find out the solution for the radgrid behaviour which is shown in the attached image.

I tried to resize the grid but no luck!

I would really appreciate if someone can guide me the solution.

BTW i am using IE8. It is absolutely working fine in IE 7 and 6 versions and the telerik version is Q1 2009.

Thanks,
Shashi
Rosen
Telerik team
 answered on 03 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?