Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
233 views
grrr...I had this working at one point and now I can't seem to figure out what's going on.

I have a page in Sitefinity 4.0 (was in 3.7) with a user control with a RadGrid in edit mode with a single record...basically I'm using it as an input form.

I'm putting the grid into edit mode in my Page_Load event using the following...
protected void Page_Load(object sender, EventArgs e)
{
    // Put the grids into edit mode on the selected request
    for (int i = 0; i < RadGrid1.PageSize; i++)
    {
        RadGrid1.EditIndexes.Add(i);
    }
}

I have a RadButton declared outside the grid as follows...
<telerik:RadButton ID="RadButton1" Skin="Default" Text="Save" Font-Underline="false"
    OnClick="RadButton1_Click" AutoPostBack="true" UseSubmitBehavior="false" runat="server" />

and the Ajax settings for this page as follows:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadButton1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Skin="Default" runat="server" />

and here is the button click event...
protected void RadButton1_Click(object sender, EventArgs e)
{
    EISDataContext db = new EISDataContext();
 
    // Get access to the grid edit item
    GridItem[] items1 = RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem);
     
    for (int i = 0; i < items1.Length; i++)
    {
        GridEditableItem item = (GridEditableItem)items1[i];
 
        // LINQ code to update database...
    }
 
    // Reset the edit index and rebind the grid
    RadGrid1.EditIndexes.Clear();
    RadGrid1.EditIndexes.Add(0);
    RadGrid1.Rebind();
}

The update code works great and the database is updated with the new values when I click the RadButton, and I see the ajax image over the grid, but the values don't update on the grid unless I do a complete page refresh or press the RadButton again. The funny thing is if I keep pressing the RadButton, the values change back and forth from the old values to the new values.

Can you see what I'm missing? Could it be something in the change to Sitefinity 4.0 that's handling ajax requests differently that's causing the issue? Thanks.
Maria Ilieva
Telerik team
 answered on 21 Nov 2013
4 answers
411 views
Hello,

Seems simple, but how do I get the MaxFileSize client side? I've created a standard JS function for validation:
function OnClientValidationFailed(sender, args) {
    try {
        var fileExtention = args.get_fileName().substring(args.get_fileName().lastIndexOf('.') + 1, args.get_fileName().length);
        if (args.get_fileName().lastIndexOf('.') != -1) {//this checks if the extension is correct
            if (sender.get_allowedFileExtensions().indexOf(fileExtention) == -1) { //alert("Wrong Extension!");
                var msg = 'The file upload has failed because this is not an allowed extension. Allowed extensions are {0}.';
                msg = msg.replace("{0}", sender.get_allowedFileExtensions());
                radalert(msg, 400, 200, 'The file upload has failed.', null, null);
            }
            else { //alert("Wrong file size!");
                var msg = 'The file upload has failed because the file is to large. Maximum file size allowed is {0} Kb.'
                msg = msg.replace("{0}", 4096000 / 1024);
                radalert(msg, 400, 200, 'The file upload has failed.', null, null);
            }
        }
        else { //alert("not correct extension!");
          var msg = 'The file upload has failed because this is not an allowed extension. Allowed extensions are {0}.';
            msg = msg.replace("{0}", sender.get_allowedFileExtensions());
            radalert(msg, 400, 200, 'The file upload has failed.', null, null);
        }
    }
    catch (ex) {
        alert("JS Error #1311161741:" + ex);
    }
    setTimeout(function () { sender.deleteFileInputAt(0); }, 10);
}

(Hope it helps others)
I thought it useful to inform the user that not only the file is to large, but also what the maximum file size is. Since this is a function that is used for many purposes, I want the function to retrieve something like: sender."get_maxFileSize"? So, get the MaxFileSize via the sender.

Thanks in advance,

Erik
Kate
Telerik team
 answered on 21 Nov 2013
4 answers
114 views
Hi,

My users have reported that they cannot see the telerik controls on the page, namely radcombobox and radlistbox buttons, in IE 9 and 10.
Please note that I tested those versions, and I dont get any error, so I can't reproduce the client error.
Here is a screenshot of the defective page:
http://i43.tinypic.com/104orpu.jpg
and a screenshot of what I see:
http://i41.tinypic.com/20auw43.jpg

The project is in asp.net .Net 4.0 and the telerik controls version are 2013.2.717.40.
As of the web page, the controls are within an radajaxpanel.
Here's an excerpt of the code: http://pastebin.com/LWqz2J7g
The controls use Sunset skin, and in the webconfig there's a  <add key= "Telerik.Skin" value "Sunset" />
Any help?
Thanks.
Edgar
Top achievements
Rank 1
 answered on 21 Nov 2013
1 answer
109 views
Hi Admin,

I am binding a RadGrid using the Client-side binding method. My grid consists of template columns with text boxes and dropdowns. I am able to bind the grid. But my problem is the Grid loads the template column controls only till the 11th row. The controls are not bound at all from Row no. 12 (Literally empty). Instead it shows the normal GridBoundColumns. Can you please help me out in this issue?

P.S: Attached is the screenshot of the behaviour.
Eyup
Telerik team
 answered on 21 Nov 2013
2 answers
106 views
Now I need to apply a CSS class to one of the axis labels, e.g. set a label to bold

What is the recomended method for doing this?

Tony
Top achievements
Rank 1
 answered on 21 Nov 2013
1 answer
157 views
Hi,

I am using Telrik Controls for ASP.NET Version Q2 2012 released 06/07/2012.
I want to implement bulk update functionality for RADGRID as mentioned below.
1 User will double click the cell/row and it will allow user to modify data
2 User will modify as many rows as he/she wants and finally click on Submit button
3 Only modified rows should get updated to detabase

Also I am binding the deta on NeedDetasource event.
I check the toutorial for batch update but it is not supporting "Batch" property under Edit mode for Master view.

please let me know how can i implement this functionality.
Princy
Top achievements
Rank 2
 answered on 21 Nov 2013
4 answers
247 views
I am dynamically creating radbuttons on a webpage, but cannot get them to post back to the server. 

Any ideas would be greatly appreciated!

Here is the code, this is within a loop creating the items:
aComboBox(aTextBoxCount) = New TextBox
aComboBox(aTextBoxCount).TextMode = TextBoxMode.MultiLine
aComboBox(aTextBoxCount).ReadOnly = True
aEditButton(aTextBoxCount) = New RadButton
aEditButton(aTextBoxCount).Text = "Edit"
aEditButton(aTextBoxCount).ID = aTextBoxCount
aEditButton(aTextBoxCount).AutoPostBack = True
AddHandler aEditButton(aTextBoxCount).Click, AddressOf EditText
 
 
aComboBox(aTextBoxCount).ID = "aComboBox" & aTextBoxCount
aComboBox(aTextBoxCount).Width = TextBoxWidth
aComboBox(aTextBoxCount).DataBind()
aComboBox(aTextBoxCount).Text = ""
 
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(New LiteralControl("<table><tr><td style=""width: 45px""></td><td>"))
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(aComboBox(aTextBoxCount))
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(New LiteralControl("</td><td>"))
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(aEditButton(aTextBoxCount))
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(New LiteralControl("</td></tr></table>"))

Shinu
Top achievements
Rank 2
 answered on 21 Nov 2013
1 answer
130 views
I have several RadDocks added to an ASP PlaceHolder in a ASP page, before the page init. After the page is loaded, I don't see the rounded corners which I enabled. The appearance of the commands don't change when I hover over them. The collapse animation seems to work, but there is no expand animation. 

The problem only arises in IE9. Within Firefox the rounded corners are displayed, etc. 
With a simpler project in IE9 - just an ASP page with a RadDock with the same settings set - the rounded corners are displayed as well. 

My assumption of the cause was HTML syntax errors in the page, however those are fixed now and the issue still appears.
Does it sound familiar? Thanks in advance. 
Slav
Telerik team
 answered on 21 Nov 2013
3 answers
153 views
Hi, we have a .net user control that works very well as an edit form within the grid, with one exception. We have an Insert button, an Update button and finally a Cancel button, with CommandNames set to Insert, Update, and Cancel respectively. Depending on whether a primary key value exists from the database, we either hide the insert button or show it. 

If we are updating, the form performs as expected and the edit form disappears and the grid updates with the new values.

But inserts fail to make the edit form disappear. If we click cancel, the edit form disappears and we see the newly inserted value in the grid. 

We were under the assumption that setting the Command Name to Insert would be what we need, but apparently this is not the case. Does anyone have any ideas on either, a) what we are doing wrong or b) a way to force the edit form to close... from within the edit form control as that is where the post back and processing takes place. Many thanks.
Viktor Tachev
Telerik team
 answered on 21 Nov 2013
4 answers
205 views
I would like to pass a parameter to the webservice that would populate my dropdown.  It doesn't appear that this is currently possible?

Specifically I want to limit the values of one dropdown from the selection made in another dropdown.
Rumen
Telerik team
 answered on 21 Nov 2013
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?