Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
68 views

Dear Telerik,

I am using rad grid with a user control in it.

And i want to showa rad alert while doing a selected action in the user control. How can i do this.

The problem is when i set the grid property enableajax= true, the rad alert will not be shown, else if the enableajax=false. then the rad alert will be shown!!

 Thanks in advance

Shinu
Top achievements
Rank 2
 answered on 11 Aug 2008
1 answer
87 views
Hello;

I have just installed RadControls_for_ASP.NET_AJAX_2008_2_723_dev and tried using the controls in Visual Studio 2005. When I publish my web application to 127.0.0.1 and access the page with the controls, I get the following error:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.RadGridUtils.RadAJAXControl.OnPagePreRenderComplete(Object sender, EventArgs e) +122
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +2063008
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2247

I have isolated the problem to RadGrid.

We were using the Q32007 Rad*.Net2 and was working super. With the new Telerik components, it seems to be causing problems with our application.

Even after uninstalling and reverting to Microsoft Ajax ASP.NET, the RadGrid is still corrupted and when rendering even in a Panel, it will give the same error.

An additional problem seems to be even with the Telerik.Web.UI dll not in the project, when declaring "using" the binary seems to still be present somewhere in the application but cannot be traced to where.

I would appreciate any advice.

Cheers,

Chris
Vlad
Telerik team
 answered on 11 Aug 2008
1 answer
88 views
Struggling to find how to do this, so any help would be appreciated.

I need to have a Radgrid positioned on a specific row when accessed. This could be a row that is 5 pages from the start.

The application shows a gridview, the user scrolls to the page where he finds the record he wants to edit, goes through the updating of that record on a different page, returns to the gridview to edit the next record but on the reload/rebind, the grid is back at the beginning.

I need to know how I can tell the RadGrid to return to the page the previous row edit was performed on. I'm open to ideas on how to do this. The Edit is actually another page being called and not the Edit Event. I would be willing to pass in a parameter if I could just figure out how to jump to that row and have the RadGrid start displaying there. The user should have the ability to page back and forth from there, I am not looking to start the RadGrid from that row, just move the position of the display to that row/page.

Thanks in advance for you help and assistance.

Clyde
Yavor
Telerik team
 answered on 11 Aug 2008
1 answer
85 views

Hi,

First let me Explain .aspx code….

<table cellpadding="0" cellspacing="0" width="100%" style="text-align: center">

<tr> <td>

<telerik:RadGrid ID="rg_AddPorts" runat="server" AllowPaging="True" Skin="Default" GridLines="Horizontal" PageSize="10" Width="100%" OnNeedDataSource="rg_AddPorts_NeedDataSource"                                 OnInsertCommand="rg_AddPorts_InsertCommand" OnItemDataBound="rg_AddPorts_ItemDataBound"                                OnUpdateCommand="rg_AddPorts_UpdateCommand">

<MasterTableView CommandItemDisplay="TopAndBottom" AutoGenerateColumns="false" DataKeyNames="Port_PortNo"                                    EditMode="EditForms" CommandItemSettings-AddNewRecordText="Add Ports">                                    <Columns>

<telerik:GridBoundColumn ReadOnly="true" Visible="false" HeaderText="Port ID" DataField="Port_PortNo"                                            UniqueName="Port_PortNo" />                                        <telerik:GridBoundColumn ReadOnly="false" HeaderText="Name" DataField="Port_PortName"                                            UniqueName="Port_PortName" HeaderStyle-Width="20%" />                                        <telerik:GridBoundColumn ReadOnly="false" HeaderText="Type" DataField="Port_PortType"                                            UniqueName="Port_PortType" HeaderStyle-Width="20%" />                                        <telerik:GridBoundColumn ReadOnly="false" HeaderText="City" DataField="Port_City"                                            UniqueName="Port_City" HeaderStyle-Width="20%" />                                        <telerik:GridTemplateColumn HeaderText="Status" Visible="false" HeaderStyle-Width="7%">

<ItemTemplate>

<asp:Label ID="lblPlaceNo" runat="server" Text='<%#Bind("Place_No") %>'></asp:Label> </ItemTemplate>                                        </telerik:GridTemplateColumn>                                        <telerik:GridTemplateColumn HeaderText="Status" Visible="false" HeaderStyle-Width="7%">

<ItemTemplate>

<asp:Label ID="Label1" runat="server" Text='<%#Bind("Port_Status") %>'></asp:Label></ItemTemplate>                                        </telerik:GridTemplateColumn>                                       <telerik:GridTemplateColumn HeaderText="Status" HeaderStyle-Width="7%">                                            <ItemTemplate>                                                <telerik:RadComboBox ID="rcbxPorts" Skin="Default" Width="100Px" Text='<%#Bind("Lookup_Value") %>'                                                    OnSelectedIndexChanged="rcbxPorts_SelectedIndexChanged" runat="server" AutoPostBack="true">                                                </telerik:RadComboBox>                                            </ItemTemplate>                                        </telerik:GridTemplateColumn>                                        <telerik:GridEditCommandColumn HeaderStyle-Width="7%">                                        </telerik:GridEditCommandColumn>                                    </Columns>

<EditFormSettings EditFormType="Template">                                        <EditColumn UniqueName="EditCommandColumn1">                                        </EditColumn>

<FormTemplate>

<!-- Grid Table Designing->

<table cellpadding="0" cellspacing="0" width="100%" class="TblMaster">                                                <tr><td style="width: 15%" align="left" class="tbtextbold">                                                        Port Name</td><td align="left">                                                        <telerik:RadTextBox Text='<%#Eval("Port_PortName") %>' ID="txtPortName" runat="server">                                                        </telerik:RadTextBox>                                                    </td> <td style="width: 15%" align="left" class="tbtextbold">                                                        Port Type

</td><td align="left">                                                        </td><td align="left">                                                        <telerik:RadComboBox ID="rcbxPortsStatus" runat="server" MarkFirstMatch="True" Text='<%#Bind("Lookup_Value") %>'                                                            Skin="Default" EmptyMessage="Select Status" Width="130px" OnSelectedIndexChanged="rcbxPortsStatus_SelectedIndexChanged">                                                        </telerik:RadComboBox>                                                    </td></tr><tr><td align="left" class="tbtextbold">                                                        Address1</td>

<tr> <td colspan="6" align="center">                                                        <asp:Button runat="server" ID="btnAddPorts" Text='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "Insert" : "Update" %>'                                                            CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'                                             CssClass="btn1" />&nbsp;&nbsp;&nbsp;                                                        <asp:Button runat="server" ID="Button1" Text="Cancel" CssClass="btn1" CausesValidation="false"                                                            CommandName="Cancel" />                                                    </td></tr></table><!-- End Grid page Designing->                                        </FormTemplate> </EditFormSettings>                               </MasterTableView></telerik:RadGrid></td></tr></table>

 

C#code:-

protected void rcbxPorts_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

{

XYZ….

}

Prob:- when ever I try to Add/Edit a record/Refresh the Grid, all the times its firing

OnSelectedIndexChanged="rcbxPorts_SelectedIndexChanged" Event.

But this prob I am facing only in Few Systems not in all the systems.

Please help me in this regards.

Yavor
Telerik team
 answered on 11 Aug 2008
2 answers
595 views
On all of my older web applications, using the RadWindow for asp.net, I could use the following below for the OnClientClose Event.

OnClientClose="window.location.href=window.location.href;"

On the new RadWindow for AJAX, if I add this to the OnclientClose event, the page gives a Java error on page when it loads and of course does not work.

What I want to do is simply refresh the original page when they close the
RadWindow.
Any suggestions?
Thanks,
~bg
Georgi Tunev
Telerik team
 answered on 11 Aug 2008
1 answer
180 views
I cannot add split buttons or dropdown buttons in a rad toolbar. I've upgraded to RadControls for ASP.NET Ajax Q2 2008, the RadToolbar version (in Reference Properties) shows to be 1.6.6.0.

The only items I can currently create in a Rad Toolbar (through Intellisense) are RadToolbarButton, RadToolbarSeparator, RadToolbarTemplateButton and RadToolbarToggleButton.

Any ideas on gaining access to the other items?
Erjan Gavalji
Telerik team
 answered on 11 Aug 2008
3 answers
134 views

All,

I have created a new skin based on the embedded Hay.  I have been successful in creating the new skin and using it in my program.  Where I am having trouble is in changing the background color in CSS file.  I have found an article which describes the various parts of the CSS file and where they refer to, but I have not been able to get the background color to change from Green. 

Can someone direct me on how to do this?

Scott

Dimo
Telerik team
 answered on 11 Aug 2008
1 answer
129 views

I have a problem updating my data what is wrong with my code? i followed the sample Extracting Values (using column Editors)

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Exam.ascx.cs" Inherits="Exam_Exam" %>  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>  
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server" OnPreRender="Page_PreRender">  
</telerik:RadScriptManager>  
<asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("semester_id") %>' Visible="true" runat="server" />  
<asp:SqlDataSource ID="SqlDataSource2" runat="server"   
    ConnectionString="<%$ ConnectionStrings:MeetWebStyleConnectionString %>"   
    SelectCommand="MWS_Exams_GetBySemester_id"   
    SelectCommandType="StoredProcedure" InsertCommand="MWS_Exams_Insert"   
    InsertCommandType="StoredProcedure" UpdateCommand="MWS_Exams_Update"   
    UpdateCommandType="StoredProcedure" DeleteCommand="MWS_Exams_Delete"   
    DeleteCommandType="StoredProcedure">  
    <SelectParameters>  
        <asp:ControlParameter ControlID="RadGrid1" DefaultValue="1" Name="Semester_id"   
            PropertyName="SelectedValue" Type="Int32" />  
    </SelectParameters>  
    <DeleteParameters>  
       <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="semester_id" />  
    </DeleteParameters>  
    <UpdateParameters>  
    <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="semester_id" />  
    </UpdateParameters>  
    <InsertParameters>  
        <asp:Parameter Direction="InputOutput" Name="Exam_id" Type="Int32" />  
        <asp:Parameter Name="Semester_id" Type="Int32" />  
        <asp:Parameter Name="Exam_name" Type="String" />  
        <asp:Parameter Name="Exam_description" Type="String" />  
        <asp:Parameter Name="Schedule_item_id" Type="Int32" />  
        <asp:Parameter Name="Library_id" Type="Int32" />  
        <asp:Parameter Name="Exam_result_grade_id" Type="Int32" />  
        <asp:Parameter Name="Start_date_range" Type="DateTime" />  
        <asp:Parameter Name="End_date_range" Type="DateTime" />  
        <asp:Parameter Name="Subject_id" Type="Int32" />  
        <asp:Parameter Name="Duration" Type="Decimal" />  
    </InsertParameters>  
</asp:SqlDataSource>  
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource2"   
    GridLines="None"   
    AutoGenerateEditColumn="false" AllowAutomaticDeletes="True"  AllowAutomaticUpdates="false"  
    AllowAutomaticInserts="True" AutoGenerateDeleteColumn="True" OnUpdateCommand="RadGrid1_UpdateCommand" OnNeedDataSource="RadGrid1_NeedDataSource"  >  
<MasterTableView DataSourceID="SqlDataSource2" AutoGenerateColumns="false"   
        CommandItemDisplay="Top" DataKeyNames="semester_id">  
 
<RowIndicatorColumn Visible="False">  
<HeaderStyle Width="20px"></HeaderStyle>  
</RowIndicatorColumn>  
 
<ExpandCollapseColumn Visible="False" Resizable="False">  
<HeaderStyle Width="20px"></HeaderStyle>  
</ExpandCollapseColumn>  
 
    <Columns>  
        <telerik:GridBoundColumn DataField="semester_id" HeaderText="Semester"   
            UniqueName="semester_id">  
        </telerik:GridBoundColumn>  
       <%-- <telerik:GridBoundColumn DataField="subjectName" HeaderText="Subject Name"   
            UniqueName="column2" >  
        </telerik:GridBoundColumn>  
          <telerik:GridBoundColumn DataField="examResult" HeaderText="Result"   
            UniqueName="column10">  
        </telerik:GridBoundColumn>--%>  
        <telerik:GridBoundColumn DataField="start_date_range" HeaderText="Start Date"   
            UniqueName="start_date_range">  
        </telerik:GridBoundColumn>  
        <telerik:GridBoundColumn DataField="end_date_range" HeaderText="End Date"   
            UniqueName="end_date_range">  
        </telerik:GridBoundColumn>  
        <telerik:GridBoundColumn DataField="exam_name" HeaderText="Exam Name"   
            UniqueName="exam_name">  
        </telerik:GridBoundColumn>  
         <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn" CancelText="Cancel"  
                        EditText="Edit">  
         </telerik:GridEditCommandColumn>  
       <%-- <telerik:GridBoundColumn DataField="exam_description" HeaderText="Description"   
            UniqueName="column6">  
        </telerik:GridBoundColumn>  
         <telerik:GridBoundColumn DataField="schedule_item_id" HeaderText="Schedule"   
            UniqueName="column7">  
        </telerik:GridBoundColumn>  
         <telerik:GridBoundColumn DataField="library_id" HeaderText="Library"   
            UniqueName="column8">  
        </telerik:GridBoundColumn>  
         <telerik:GridBoundColumn DataField="Exam_result_grade_id" HeaderText="Result"   
            UniqueName="column9">  
        </telerik:GridBoundColumn>  
          <telerik:GridBoundColumn DataField="subject_id" HeaderText="subject"   
            UniqueName="column10">  
        </telerik:GridBoundColumn>  
          
         <telerik:GridBoundColumn DataField="duration" HeaderText="Duration"   
            UniqueName="column10">  
        </telerik:GridBoundColumn>--%>  
    </Columns>  
 
<EditFormSettings>  
<PopUpSettings ScrollBars="None"></PopUpSettings>  
</EditFormSettings>  
</MasterTableView>  
<ClientSettings Selecting-AllowRowSelect="true">  
<Selecting AllowRowSelect="True"></Selecting>  
    </ClientSettings>  
</telerik:RadGrid>  
 
 
 
 

using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
using Telerik.Web.UI;  
using System.Data.SqlClient;  
public partial class Exam_Exam : System.Web.UI.UserControl  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
         
 
    }  
    protected void Page_PreRender(object sender, System.EventArgs e)  
    {  
         
        this.RadGrid1.MasterTableView.Rebind();  
        this.RadGrid1.Rebind();  
    }  
 
    public DataSet ExamData  
    {  
        get  
        {  
            object obj = this.Session["ExamsData"];  
            if (obj != null)  
            {  
                return (DataSet)obj;  
            }  
 
            DataSet examData = new DataSet();  
 
            String ConnString = ConfigurationManager.ConnectionStrings["MeetWebStyleConnectionString"].ConnectionString;  
            SqlConnection conn = new SqlConnection(ConnString);  
            SqlDataAdapter adapter = new SqlDataAdapter();  
            adapter.SelectCommand = new SqlCommand("SELECT semester_id,start_date_range,end_date_range,exam_name from MWS_Exams", conn);  
 
            adapter.Fill(examData, "Exam");  
 
            this.Session["ExamsData"] = examData;  
            return examData;  
        }  
    }  
 
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
    {  
          
        try  
        {  
 
            thisthis.RadGrid1.DataSource = this.ExamData;  
            this.ExamData.Tables["Exam"].PrimaryKey = new DataColumn[] { this.ExamData.Tables["Exam"].Columns["semester_id"] };  
 
        }  
        catch (Exception ex)  
        {  
            RadGrid1.Controls.Add(new LiteralControl("<strong>Unable to set value of column '" +  ex.Message));  
            
        }  
 
    }  
    protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)  
    {  
        GridEditableItem eeditedItem = e.Item as GridEditableItem;  
        GridEditManager editMan = editedItem.EditManager;  
 
        foreach (GridColumn column in e.Item.OwnerTableView.RenderColumns)  
        {  
            if (column is IGridEditableColumn)  
            {  
                IGridEditableColumn editableCol = (column as IGridEditableColumn);  
                if (editableCol.IsEditable)  
                {  
                    IGridColumnEditor editor = editMan.GetColumnEditor(editableCol);  
 
                    string editoreditorType = editor.ToString();  
                    string editorText = "unknown";  
                    object editorValue = null;  
 
                    if (editor is GridTextColumnEditor)  
                    {  
                        editorText = (editor as GridTextColumnEditor).Text;  
                        editorValue = (editor as GridTextColumnEditor).Text;  
                    }  
 
                    if (editor is GridBoolColumnEditor)  
                    {  
                        editorText = (editor as GridBoolColumnEditor).Value.ToString();  
                        editorValue = (editor as GridBoolColumnEditor).Value;  
                    }  
 
                    if (editor is GridDropDownColumnEditor)  
                    {  
                        editorText = (editor as GridDropDownColumnEditor).SelectedText + "; " +  
                            (editor as GridDropDownColumnEditor).SelectedValue;  
                        editorValue = (editor as GridDropDownColumnEditor).SelectedValue;  
                    }  
 
                    try  
                    {  
                        
 
                        DataRow[] changesRow = this.ExamData.Tables["Exam"].Select("semester_idsemester_id = " + editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["semester_id"]);  
                        changesRow[0][column.UniqueName] = editorValue;  
                          
                        this.ExamData.Tables["Exam"].AcceptChanges();  
                    }  
                    catch (Exception ex)  
                    {  
                        RadGrid1.Controls.Add(new LiteralControl("<strong>Unable to set value of column '" + column.UniqueName + "'</strong> - " + ex.Message));  
                        e.Canceled = true;  
                        break;  
                    }  
                }  
            }  
        }  
    }  
}  
 

Vlad
Telerik team
 answered on 11 Aug 2008
2 answers
229 views
I have created a check box column for the radgrid. On results page change the selected rows are lost.  Can someone suggest a method to preserve the selected grid items during page changes?
Shinu
Top achievements
Rank 2
 answered on 11 Aug 2008
1 answer
175 views
Hi,

In one of our application's page we have a repeater which displays results and contains controls such as hyperlinks which display certain contents in a tooltip.

The content which is to be displayed in the tooltip is same for all the items of repeater and is in a user control. As its same, it doesnt really make sense to add multiple instances of this user control for each repeater item.

I tried with Tooltip manager as well which can have multiple target controls but its more suited to on load demands, and content being the same i dont want to make a request to the server every time when user clicks for tooltip.

What I am looking for is adding my tooltip content user control once in a page and then display it with multiple targets without calling server.

I am just wondering what would be the best way to do it.

Thanks in advance.

Regards,
Khurram
Kevin Babcock
Top achievements
Rank 1
 answered on 10 Aug 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?