Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
108 views
I created a RadGrid and have a image button as a column; when I click image button, I need to open a new window with some existing page, passing some value.

Here's what I did. Please help:
1. created a RadGrid with OnItemCommand="RadGrid1_ItemCommand; and created a image button.

                <telerik:GridTemplateColumn AllowFiltering="false">
                    <ItemTemplate>
                        <asp:ImageButton ID="imgbtnEdit" ToolTip="Edit Solution" CommandName="modify" 
                            CommandArgument='<%# Bind("solution_id") %>' runat="server" ImageUrl="~/Images/edit.gif" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="2%"></ItemStyle>
                    <ItemStyle BorderStyle="Solid" HorizontalAlign="Left" VerticalAlign="Top" Width="1%" />

2.created .js file with following code
      function EditSolution(SolutionID)
      {
          var newWindow;
          var WindowName;
          WindowName = strSessionID + "EditSolution" + SolutionID;
          newWindow = window.open(
         strPublicMap + "/" + strDispLangCode + "/solutions/processsolution.asp?command=edit&solutionID=" + SolutionID,
         WindowName,
         "toolbar=yes,channelmode=no,menubar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,height=470,width=750,left=1,top=1");
      }

 3. reference in .aspx file
<head id="Head1" runat="server">
    <title></title>
    <script language ="javascript"  type="text/javascript" src ="../Script/Home.js"></script> 
</head>

4. in code behind file

    Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand

        Dim strCommandName As String = e.CommandName.ToLower()
        Dim sTitle As String = ""
        Dim intIndex As Integer

        If (strCommandName = "browse" Or strCommandName = "modify" Or strCommandName = "attachment") Then
            intIndex = Convert.ToInt32(e.CommandArgument)
            Select Case strCommandName
                Case "modify"
                    EditSolution(intIndex)
                Case "attachment"
            End Select
        End If

Protected Sub EditSolution(ByVal iSolutionID As Integer)
        Dim strScript As String = String.Empty

        strScript = "javascript:EditSolution(" & iSolutionID & ");"
        ScriptManager.RegisterStartupScript(Me.RadGrid1, Me.GetType, "OpenAttachments", strScript, True)
End Sub

The js file should be fine since it is used by production. I just start to use telerik grid. I believe last line code is wrong, but not sure how to fix it.         ScriptManager.RegisterStartupScript(Me.RadGrid1, Me.GetType, "OpenAttachments", strScript, True)
Thanks in advance!
 

Pavlina
Telerik team
 answered on 11 Jul 2011
2 answers
717 views
I am calling the RadAlert function in my code behind when a user clicks on the "Login" button. This is a very simple page with very simple functionality and I am following the examples to a tee, but still nothing. I am thinking it is because I am calling the function within a catch block when the login is unsuccessful, meaning that I am trying to display the window when the execution isn't finished. Can someone help me with this as I am stumped as to how best to proceed? My HTML and C# code is below:

<form runat="server" id="frmLogin">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadWindowManager ID="LoginWindowManager" runat="server" EnableShadow="true" Skin="Telerik" />
    <div class="loginDiv">
        <asp:Image ID="ivxLogo" AlternateText="iVidix Logo" ImageUrl="./img/ividix_logo.jpg" Height="150px"
                    Width="110px" runat="server" />
        <p>Welcome to the Instructional Video Exchange. Please login to access your videos.</p>
        <div align="center">
            <table border="0" cellpadding="0" cellspacing="10">
                <tr>
                    <td>UserName:</td>
                    <td>
                        <telerik:RadTextBox ID="txtUserName" runat="server" Width="150px" TabIndex="0" Skin="Vista" />
                    </td>
                </tr>
                <tr>
                    <td>Password:</td>
                    <td>
                        <telerik:RadTextBox ID="txtPassword" runat="server" Width="150px" TabIndex="1"
                            TextMode="Password" Skin="Vista">
                        </telerik:RadTextBox></td>
                </tr>
                <tr>
                    <td>Institution:</td>
                    <td>
                        <telerik:RadComboBox ID="ddlInstitutions" runat="server" DataSourceID="srcInstitutions"
                            DataTextField="Name" DataValueField="InstID" TabIndex="2" Skin="Vista" AllowCustomText="True">
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right"><asp:Button ID="btnSubmit" runat="server"
                            Text="Login" onclick="btnSubmit_Click" TabIndex="3"/></td>
                </tr>
            </table>
        </div>
    </div>
</form>


try
{
   String encryptPwd = CryptoHelper.Encrypt(password);
    //log.Debug("Encrypted version of the password: " + password + " is " + encryptPwd);
    userSession = SessionManager.CreateSession(userName, encryptPwd, instID);
}
catch (IvidixException ex)
{
    String ErrorMessage = "UserName and/or Password in combination with the Institution were not valid. Please try again.\n";
    ErrorMessage = ErrorMessage + "Specifically, " + (String) ex.LocalMessages[0] + "\n";
    ErrorMessage = ErrorMessage + "Please contact Ividix Support if you feel that this error is incorrect.";
 
    log.Error("UserDetail Session was not created properly and therefore not stored within the HttpSession.");
    log.Debug("End btnSubmit_Click");
 
    LoginWindowManager.RadAlert(ErrorMessage, 350, 200, "Error", "");
 
    return;
}

Brian
Top achievements
Rank 1
 answered on 11 Jul 2011
2 answers
242 views
Hi ,

I'm using resource control in the Advance form.
I want to set default value for that control. How to access resource control in FormCreated event.

I was able to access text box and checkbox like this

CheckBox

 

 

ch = (CheckBox)e.Container.Controls[1].FindControl("IsPrivateCheckbox");

 

ch.Checked = System.

 

Convert.ToBoolean("True");

 

 

 

RadTextBox SubjectTextbox = (RadTextBox)e.Container.Controls[1].FindControl("SubjectText");

 

SubjectTextbox.Text = Session[

 

"PersonName"].ToString() + " On Call";


Please help.

 

Sam
Top achievements
Rank 1
 answered on 11 Jul 2011
1 answer
88 views
When using the Zoom feature of IE8 (I haven't tested any other browsers or versions) the graphics in the skin of the RadTabstrip do not display properly.

I'm attaching two images to illustrate the problem (IE8/Win7) with Zoom set to 400%.

1. The first is a screenshot of a tabstrip using the Default skin (directly from the Telerik demos area).
2. The second is a screenshot of a tabstrip using the Sitefinity skin (from a site I'm developing).

In both, notice the vertical degradation/corruption appearing in the graphic display of the Telerik tabstrip.

Is there anything I can do to fix this?

I'm a subscribing customer using RadControls for ASP.NET AJAX Q1 2011 (2011.1.519.35).

Thanks.
Dimitar Terziev
Telerik team
 answered on 11 Jul 2011
1 answer
147 views
Hi ,
I m using RadCalendar which is a MultiViewRows , and I am navigating Some Custom Date Selection when we click the Fast navigation. I using Client Side event but it throws Date2 must be array: [y, m, d]. Here below i show my code , please suggest me where is error.

<telerik:RadCalendar runat="server" Skin="Windows7" ID="RadCalendar1" AutoPostBack="true"
                                       TitleFormat="MMM-yy" EnableMultiSelect="false" MultiViewRows="3" MultiViewColumns="1"
                                       PresentationType="Interactive" HideNavigationControls="true" DayNameFormat="FirstTwoLetters"
                                       ShowOtherMonthsDays="false" FastNavigationStep="1" EnableNavigation="true" EnableMonthYearFastNavigation="False">
                                       <ClientEvents OnCalendarViewChanged="CheckSelections" />
                                   </telerik:RadCalendar>
function CheckSelections(sender, eventArgs) {
            var selDates = sender.get_selectedDates();
            var calendar = $find("<%=RadCalendar1.ClientID%>");
            var dates = calendar.get_selectedDates()
            var date = dates[0]
            var year = date[0];
            var month = date[1];
            var day = date[2]
            var mydate = month + "/" + day + "/" + year
            mydate = DateAdd(mydate, "M", 1); 
            var datearray = mydate.format("yyyy, M, d");
            var arr = [datearray];
            calendar.selectDate(arr,true);  
        }
Genti
Telerik team
 answered on 11 Jul 2011
1 answer
374 views
Hey!

I have a simple solution, but i am encountering some problems.

On my page I have 2 grids: rgItems and rgDeletedItems.

Columns in rgItems are: ItemName, ItemDetails (which is a link to a page with item details) and Delete (a button that deletes an item). In my DataBase Item has a property IsDeleted, so I delete it just by setting that property. When you click the button the IsDeleted property is set to true and I call rebind() on both grids (that is how I triger the needdatasource and grids refresh).

Columns in rgDeletedItems are: ItemName and button Renew (this button sets IsDelete to false and rebinds both grids, and that is how I move an item back to rgItems).

So in rgItems are Items with IsDeleted == true and in rgDeletedItems are items with IsDeleted = false.

Everyhing works well so far.

Let's make a scenario. We have 3 items RedItem, GreenItem and BlueItem, they are not deleted (IsDeleted == true on all of them), so when we come to page they are all in rgItems, the grid rgDeletedItems is emtpy. Let's say we delete RedItem. So in rgItems we now have 2 items, GreenItem and BlueItem and in grid rgDeletedItems we have RedItem. Then we click on a link on top grid let's say we look at the details of GreenItem, the page opens and everything is fine.
The problem is: when we click back in our browser to go back to the page with grids, initial grid will be loaded (3 item in rgItems and no items in rgDeletedItems), however if we refresh the page everything will be fine again. So the thing is that the back button loads the page that happend on first pageload (!IsPostBack), and it doesn't remember any of the changes that were made after.

Is this possible to make it so, the Page_Load would fire even when you click Back/Forward buttons in browser?

I am thankful for any assistance you can provide.

Sincerely, Jure
Pavlina
Telerik team
 answered on 11 Jul 2011
1 answer
80 views
I have created a RadGrid control with a detail table programatically on page_init; imagine Country -> Regions

When the "Open" nested table icon is clicked, the whole page is posted back and as a result the Country list is re-populated then the regions associated with the selected country gets loaded.

The problem is that the Country list is already on the page, why everything should be reloaded again since only one country was selected to retrieve its regions.

As a result of this problem, my RadGrid is slow when using its nested tables as it has to reload all other layers each time.

How would that be possible to only load the nested table which is required rather than loading the whole Grid?

Many thanks,
Genti
Telerik team
 answered on 11 Jul 2011
1 answer
155 views
I recently downloaded the latest maintenance release and installed it yesterday.  I was testing some code today which contained an instance of the Editor.  I am having a strange problem when trying to create new bullet items.

I have attached two screen captures to show what is happening.  The first screen capture was taken BEFORE clicking the Bullet Item button.  It should be noted that before the Bullet Item button was clicked, the cursor was sitting 2 carriage returns below the second paragraph.

The HTML in the control before clicking the Bullet Item button is shown immediately below:

<span style="font-family: arial; font-size: 12px;">
<p><span style="font-family: arial; font-size: 12px;">When THDi Software builds a public website for your company, you will have the option of making certain "content mangement" fucntionality available for approved employees on your staff to use to maintain the text and verbiage on your website.<br />
<br />
There are many different categories of information for your maintenance purposes.  These tools will reduce the time you need to spend maintaining your website and will reduce your total charges for our labor.  Of course, if you want, we can maintain this information for you.<br />
<br />
</span></p>
</span>
<p> </p>


What I wanted to accomplish was to create a new bullet item UNDER the second paragraph.

The second screen capture shows what the Editor did when I clicked on the Bullet Item button.  Please understand, the cursor really was positioned two (2) carriage returns BELOW THE SECOND PARAGRAPH.

The created HTML after the action is immediately below:
<span style="font-family: arial; font-size: 12px;">
<p> </p>
</span>
<p> </p>
<ul>
    <li><span style="font-family: arial; font-size: 12px;">When THDi Software builds a public website for your company, you will have the option of making certain "content mangement" fucntionality available for approved employees on your staff to use to maintain the text and verbiage on your website.<br />
    <br />
    There are many different categories of information for your maintenance purposes.  These tools will reduce the time you need to spend maintaining your website and will reduce your total charges for our labor.  Of course, if you want, we can maintain this information for you.<br />
    <br />
    </span></li>
</ul>


Is there a problem with the Editor?  Why, with all of the carriage returns included in the text, did it go back to the first paragraph and create a bullet item?

Lynn
Rumen
Telerik team
 answered on 11 Jul 2011
2 answers
73 views
Hello, 

So I seem to have stumbled upon a very strange issue with the RadRotator that I have setup on one of my pages. I have two control buttons for scrolling left and scrolling right. When you click the scroll left control button all the way to the right it scrolls to the left, but if you click the scroll left control button on the left side of the button it scrolls the rotator to the right. Anyone have any idea as to why? The buttons that I am using are radbuttons with an image sprite doing the graphics. Please take a look at the link below to see the issue in action.

http://myheadpiece.com/test/Pages/HatCustomizerPage.aspx
Bruce
Top achievements
Rank 1
 answered on 11 Jul 2011
5 answers
229 views
Hi, we have a grid that for some reason renders differently from our PCs when we publish our web application to production.  The grid has static column headers, and we set its width to 100%.  For some reason, when we develop it in our PCs, it displays perfectly, with the content taking up the entire grid.  When we publish the same exact code to our production server (or any other server so that the application is not running locally on our PCs when we access it), and the grid is still set to 100%, but the content doesn't take up the whole grid.  When I run the rendered HTML code through WinDiff, it tells me that the following line renders differently:

In development:
<table cellspacing="0" class="rgMasterTable rgClipCells" border="0" id="Domestic_userControl_rgDomestic_ctl00_Header" style="width:100%;table-layout:fixed;overflow:hidden;text-overflow:ellipsis;empty-cells:show;"> 

In production:
<table cellspacing="0" class="rgMasterTable rgClipCells" border="0" id="Domestic_userControl_rgDomestic_ctl00_Header" style="table-layout:fixed;overflow:hidden;text-overflow:ellipsis;empty-cells:show;"> 

Notice how in development it adds "width: 100%".  Both are using the same exact code however:
<telerik:RadGrid runat="server" ID="rgDomestic" AllowFilteringByColumn="true" 
                                    AllowSorting="true"  ShowFooter="True" EnableLinqExpressions="false" 
                                    AllowPaging="True"  AllowMultiRowSelection="true" 
                                    ShowGroupPanel="true" ShowHeader="true" 
                                    PageSize="15" 
                                           
                                 AutoGenerateColumns="false">  
                                 <ClientSettings Selecting-AllowRowSelect="true"  ClientEvents-OnGridCreated = "DomesticGridCreated"  AllowDragToGroup="true" AllowGroupExpandCollapse="true"  EnableRowHoverStyle="true" ClientEvents-OnRowDblClick="RowDoubleClick" > 
                              <Scrolling AllowScroll="True" UseStaticHeaders="true" SaveScrollPosition="true" FrozenColumnsCount="2"/>  
                             </ClientSettings> 
                             <GroupingSettings ShowUnGroupButton="true" /> 
                                   <MasterTableView GroupsDefaultExpanded="false" GroupLoadMode="Client" HierarchyLoadMode="Client" ClientDataKeyNames="DocNum" DataKeyNames="DocNum">  
                                            <Columns> 

I attached two Screenshots, capture1 of the production result which doesn't seem to render correctly, and capture2 which is the result when we run it locally on our PCs which does seem to render correctly.  Why could this be happening?

Thank you!


Pavlina
Telerik team
 answered on 11 Jul 2011
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?