Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
160 views
I have a grid which has only one column. it contain image and a text. When i try to drag by clicking on image it won't start dragging operation but i do the same thing with text it start dragging.

Is it a problem with z-index, could you provide proper solution on that ?
Pavlina
Telerik team
 answered on 24 Oct 2012
5 answers
459 views
It must be very simple but I can't work it out
I've got a grid
<telerik:RadGrid ID="RadGrid1"                           
                            runat="server"
                            ShowHeader="False"
                            AutoGenerateColumns="False"                                                                                                                 
                            >                       
                             
                <MasterTableView                                 
                                    DataKeyNames="AppID, IDCart, IDOrder">
                                     
                    <Columns>
                         
..............                       
 
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn" >
                            <HeaderStyle Width="335px" />                                     
                        <ItemTemplate>
                                <asp:Literal ID="myLiteral" runat="server" />
                          </ItemTemplate>  
                       </telerik:GridTemplateColumn>
                               
                        <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"                       
                            ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                            UniqueName="DeleteColumn">
                            <HeaderStyle Width="15px" />
                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                        </telerik:GridButtonColumn>
                         
                    </Columns>                  
                </MasterTableView>                  
        </telerik:RadGrid>

(myliteral is filled on temDataBound event.)
I bind the grid on code behind needdatasource event. It works fine.
If I click the GridButton to delete, raising RadGrid1_DeleteCommand event, it performs the delete function. It works fine


Now I just need to add Ajax to this.
so
<telerik:RadAjaxManager ID="RadAjaxManagerCart" runat="server">
            <AjaxSettings>           
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />                            
                        <telerik:AjaxUpdatedControl ControlID="myLiteral" />                                                   
                    </UpdatedControls>
                </telerik:AjaxSetting>           
            </AjaxSettings>
        </telerik:RadAjaxManager>

It is not working. The RadGrid1_DeleteCommand event is performed, but it does not refresh the grid

Could you help me please?
Eyup
Telerik team
 answered on 24 Oct 2012
2 answers
357 views
I've been searching your forums and reading documentation for several days now but have been unable to figure out how to access an updated item in my RadGrid.  

Basically, I have a RadGrid with a Client Event where OnCommand is set to "RaiseCommand".

In my JavaScript RaiseCommand function, I am able to determine the command that was raised.  When the command raised is "Update" I am calling ValidateInput function, passing along the sender and eventArgs that was passed to the RaiseCommand function.

Inside ValidateInput, I need to access updated values and do some edits to ensure the new values meet specific requirements.  However I have been unable to figure out how to access the new values.

So I thought I'd try accessing the new values in my codebehind.  I thought that if I could figure out how to do it there, I could use the same method in my javascript.  I created subroutines that handle EditCommand, and UpdateCommand.

Inside my subroutine for EditCommand, I have been able to find and display in a message box, the values in the row where Edit was clicked.

When I execute my web page, after clicking Edit on a row in my RadGrid, I then modify the contents of one of the four fields.  I then click on Update and my subroutine for UpdateCommand is invoked.  Inside this subroutine, I have been able to succesfully find and display the SavedOldValues.  However, I am unable to find the new value that I entered into one of the fields. 

Here's some of my code:
<telerik:RadGrid ID="rgUsers" runat="server" BorderWidth="1" BorderColor ="#EBAB00" AutoGenerateColumns="false" AllowSorting="true" >
    <ClientSettings>
        <ClientEvents OnCommand="RaiseCommand" />
    </ClientSettings>
    <ItemStyle Font-Size="10pt" Font-Names="Sans-serif" />
    <HeaderStyle Font-Size="12pt" Font-Names="Sans-serif" />
    <MasterTableView EditMode="InPlace">
        <Columns>
            <telerik:GridBoundColumn UniqueName="UserId" DataField="UserId"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="username" DataField="username"></telerik:GridBoundColumn>
             <telerik:GridBoundColumn UniqueName="level" DataField="level"></telerik:GridBoundColumn>
             <telerik:GridBoundColumn UniqueName="subcatid" DataField="subcatid"></telerik:GridBoundColumn>
             <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
             <telerik:GridClientDeleteColumn ConfirmText="Are you sure you want to delete this user?></telerik:GridClientDeleteColumn>
         </Columns>
     </MasterTableView>
</telerik:RadGrid>

Private Sub rgUsers_EditCommand(ByVal sender As Object, ByVal e As
Telerik.Web.UI.GridCommandEventArgs) Handles rgUsers.EditCommand
        Dim gdi As GridDataItem = CType(e.Item, GridDataItem)
        Dim UserId As String
        Dim UserName As String
        Dim Level As Integer
        Dim SubCategoryID As Integer
 
        UserId = gdi.Item("UserId").Text
        UserName = gdi.Item("username").Text
        Level = CType(gdi.Item("level").Text, Integer)
        SubCategoryID = CType(gdi.Item("subcatid").Text, Integer)
        MsgBox("EditCommand on " & UserId & " " & UserName & " " & Level.ToString & " " & SubCategoryID.ToString)
 
    End Sub

Private Sub rgUsers_UpdateCommand(ByVal sender As Object, ByVal e As
Telerik.Web.UI.GridCommandEventArgs) Handles rgUsers.UpdateCommand
        Dim rg As RadGrid = CType(sender, RadGrid)
        Dim gdie As GridDataItem = CType(e.Item, GridDataItem)
        Dim UpdatedRow As Integer = gdie.ItemIndex
        Dim MasterTable As GridTableView = rg.MasterTableView
        Dim gdim As GridDataItem = MasterTable.Items(UpdatedRow)
        Dim cell As TableCell
        Dim i As Integer
 
        MsgBox(gdim.SavedOldValues("UserId").ToString)
        MsgBox(gdim.SavedOldValues("username").ToString)
        MsgBox(gdim.SavedOldValues("level").ToString)
        MsgBox(gdim.SavedOldValues("subcatid").ToString)
 
        i = 0
        For Each cell In gdie.Cells
            MsgBox(i.ToString & " " & cell.Text)
            i += 1
        Next
 
        i = 0
        For Each cell In gdim.Cells
            MsgBox(i.ToString & " " & cell.Text)
            i += 1
        Next
End Sub

After I click on Update, my UpdateCommand handler fires, and I see message boxes containing the four saved old values.  But the following messages boxes (2 sets of 8) all display &nbsp.

I know there must something fundamental that I'm missing, but for the life of me, I've been unable to figure it out.

Please tell me how I can access the updated values in my codebehind, and then also in javascript.

Thanks!
Andrey
Telerik team
 answered on 24 Oct 2012
1 answer
151 views
I'm searching for hours now but nothing I found worked.
I tried out instructions telerik gave and also other approaches.

The page works fine on the first load, but when i push the save button there comes the
error und nothing works.

You can look at the page on http://www.easyteamorganiser.com:82

THANKS FOR HELP!

Sincerely, Skim

Marin Bratanov
Telerik team
 answered on 24 Oct 2012
7 answers
252 views
Is there a way to export the scheduler into a landscape mode so it fits the entire PDF width? I tried setting the PDF PageHeight and PageWidth to be in landscape, but it ended up only filling half the page width. If I'm missing something, please let me know.

Here is a link to a screenshot of what I got.

http://screencast.com/t/jlBAEf4Nm50

Thanks,
Adam
Bozhidar
Telerik team
 answered on 24 Oct 2012
1 answer
174 views
Hello,

I'm working with the asp.net RadChart, trying to more finely tune the displayed labels associated with a chart.

Specifically, I'd like to start the axis labels and ticks at a point not at the start of the data, or at 0. In the attached files, I have my current chart's axis (with RadChart) where the labels start at the minValue and end with the maxValue of the Axis.

Target.png represents what I'd like to see in the chart, with the label starting at a pre-defined point in the data. In this case, I'd like to start my labeling at July 1, 2010 instead of April 28, 2010 in the dataset.

Is there an easy way to do this?


Thanks,
Alex Bucevicius
Petar Marchev
Telerik team
 answered on 24 Oct 2012
5 answers
215 views
I need to change the maxlength clientside in a RadTextBox depending on a selection in a combobox.  I tried this:

 

var txt = $find("<%= txtValue.ClientID %>");

 

 

var item = eventArgs.get_item();

 

 

var value = item.get_value();

 

 

switch(value)

 

{

 

case "CUST_NU":

 

txt.MaxLength = 8;

 

break;

 

 

case "NAME":

 

txt.MaxLength = 30;

 

break;

 

 

case "CIC":

 

txt.MaxLength = 4;

 

break;

 

 

case "INVOICE_NU":

 

txt.MaxLength = 10;

 

break;

 

}

Then checked for the maxlength via alert(txt.MaxLength) and it shows the new maxlength value but the textbox still doesn't change to the new length.

Heinrich
Top achievements
Rank 1
 answered on 24 Oct 2012
2 answers
86 views

onclientRequestSuccess does not seem to have the updated firstDayStart().  I thought I had figured it out, but its not working:

As I navigate in the calendar, changing months, it does not reflect the right day - what am I doing wrong?

function onClientRequestSuccess(scheduler, eventArgs) {
    if (typeof loadList == 'function') {
        var start = scheduler.get_firstDayStart();
        var end = start;
        var curView = scheduler.get_selectedView();
        if (curView == 0) {  // day view
            end.setHours(start.getHours() + 24);
        } else if (curView == 1) {  // week view
            end.setHours(start.getHours() + (24 * 7));
        } else if (curView == 2) {  // week view
            end.setMonth(start.getMonth() + 1);
            // need to find out if we are on a Saturday..  If not, we need to add days until we get there
        }
        alert(start + " **- " + end);
        loadList(start.getTime(), end);
    }
}
Boyan Dimitrov
Telerik team
 answered on 24 Oct 2012
3 answers
124 views
Hi All,

I created a button in a radgrid with below code. When I try to reach the value in columns that is okay. I can make it.

But I try to make a request with these parameters on my web service. I get this error "property of value is null or undefined" at runtime.

Now I am thinking I create these buttons dynamically. Is that the reason I cant make a request?

Please help.

protected void rgGeneralSearch_ItemDataBound(object sender, GridItemEventArgs e)<br>        {<br><br>            if (e.Item is GridDataItem)<br>            {<br>                GridDataItem gridDataItem = (GridDataItem)e.Item;<br>                Button btnAdd =<br>                    (Button)gridDataItem["Add"].FindControl("btnAdd");<br>                RadNumericTextBox txtQuantity =<br>                    (RadNumericTextBox)gridDataItem["Quantity"].FindControl("txtQuantity");<br><br><br>                //btnAdd.Attributes["onclick"] = "btnAddClick('" + txtQuantity.ClientID + ", "+ rgGeneralSearch.MasterTableView.GetColumn("Code") + "')";<br>                btnAdd.Attributes["onclick"] = "btnAddClick('" + txtQuantity.ClientID + "', '"+ e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Code"] +"')";<br>                //btnAdd.Attributes["href"] = "#";<br>                btnAdd.Attributes.Add("ajax", "");<br>            }<br>        }


function btnAddClick(Quantity, Code) {<br>    alert($get(Quantity).value);<br>    alert(Code);<br><br>    var SenderType = 1;<br>    var SenderId = 22;<br>    var ProductId = 333;<br>    var CustomerId = 99;<br>    var SalesmanId = 88;<br>    var DiscSpecial = 23;<br>    var TerminalNumber = 234;<br><br>    var webMethod = "http://localhost:5261/WS/Basket_WS.asmx/InsertBasket";     <br>    var parameters = "{'SenderType':'" + SenderType + "', 'SenderId':'" + SenderId + "', 'ProductId':'" + ProductId + "', 'CustomerId':'" + CustomerId + "', 'SalesmanId':'" + SalesmanId + "', 'Quantity':'" + 22 + "','DiscSpecial':'" + DiscSpecial + "','TerminalNumber':'" + TerminalNumber + "'}";   <br>    $.ajax({<br>        type: "GET",<br>        url: webMethod,<br>        data: parameters,<br>        contentType: "application/json; charset=utf-8",<br>        dataType: "json",<br>        success: OnGetSuccess,<br>        error: OnGetError<br>    });<br>}
Radoslav
Telerik team
 answered on 24 Oct 2012
6 answers
605 views
I am using master pages in my asp.net web app. I receive this error:

The control with ID 'RadScriptManager1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.


I've tried just about every combination of where to put this tag and nothing works. What do I need to add to the master page and what do I add to the pages inherited from the master page? And most importantly WHERE to place the tag?
<asp:ScriptManager ID="ScriptManager1" runat="server" />
Jorge irving
Top achievements
Rank 1
 answered on 23 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?