Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
189 views
I have upgraded my asp.net web project's telerik version from 2012.3.1308.35 to 2014.2.724.40. After the upgrade I noticed that radgrid filtering does not work as expected. The issue is with GridBoundColumn filtering and when I type something in filter textbox and press enter it does not do a postback as expected. As I have found out there is a script error in the page which says "Uncaught TypeError: Cannot read property 'getElementsByClassName' of null". 
I tried to isolate this problem in a new asp.net web project and issue is visible in there as well so I am pretty sure this does not happen because of something related to my project.

Thanks
Pavlina
Telerik team
 answered on 26 Aug 2014
2 answers
761 views
I have a grid that is populated by a SQL Datasource control. When the user edits a row, an edit form template is displayed. Inside this template is a combobox that I populate server-side with values in a dictionary. How do I set the selected value when the edit form template is displayed? Textboxes in the edit form template use the 'Bind' value for their text values, and other comboboxes in the template have a DataSourceID set, so when SelectedValue is set, it's not a problem.

So, I guess my question is multipart.

1. In what event should I be setting the combobox load?
2. For the combobox, how do I set the selected value to be that of the item in the grid?
Steve
Top achievements
Rank 1
 answered on 26 Aug 2014
9 answers
663 views
Hello Team,
Our requirement is to remove all the color gradiations (color combination of 2 or more colors) from our entire web application. 
As part of Grid. I have applied plain / flat color to the columns. But I am unable to do the same with Command Bar Item, I mean above the columns header. You can have clean look in attached image. 

Guys, please let me know. How to remove gradiation color from grid command bar. 
Just I want to keep background color as light gray (#E6E6E6). Let me know if you need any more information.


Thanks a lot in advance for any inputs.

Venelin
Telerik team
 answered on 26 Aug 2014
1 answer
781 views
I am very interested in using batch edit, but as most of the logic in our application is server-side, I need a way to server-side call a method on the RadGrid which is in Batch Edit mode upon post back of the page that asks it to save all edited items if any exist.

We have a save button which is OUTSIDE of the radgrid that saves not just the radgrid but also other data in the formview control - so when they click on that save button I want to invoke the save changes in the radgrid which is in batch edit mode.

Also in case they forget to click on the button but click on something else I want to auto-save without any user confirmation upon post back to the save (since I understand that all user changes are lost upon postback when you are in radgrid batch edit mode). How can I invoke "save batch mode if there are any changes" from a page_load method for example.

I see this http://www.telerik.com/support/code-library/prevent-losing-batch-editing-changes-on-paging-or-any-other-postback but I don't want a "are you sure" asked of the user - just an automatic invoking of saving any changed rows in the batch without asking the user any questions or requiring the user to click on any other buttons.

I cannot find this in the docs. It seems as if Telerik only allows invoking the save of radgrids in batch edit from client side javascript - not server side c#.
Marin
Telerik team
 answered on 26 Aug 2014
1 answer
557 views
Hi
I am facing an issue with this control. Any help is much appreciated.Below is my requirement
I have to allow maximum of 3 valid files to be uploaded so I set MaxFileInputsCount=3. Now I have some clientside validations and if the files are invalid I am removing them and I cannot see the files in UI but the upload control is not getting back to its original state. Lets say I upload a file and if it is valid I stream it to my DB. Now the count is 1 . I try again with another file and it is not a valid file then I show a message to the user and after the next upload the which is a valid file I am not seeing the upload control. EVen though I have just 2 files uploaded , the control is disappearing. Can anyone help me to resolve this issue. below is my script

function onClientFileUploading(sender, args) {
    debugger;
    var message = "";
    var errorWithFile = false;
    var regEx = /[~#%&*{}:<>?\/|\'\"]/;

    //Invalid Characters in File Name
    if (regEx.test(args.get_fileName())) {
        message = "File: " + args.get_fileName() + " contains invalid characters.  It has not been uploaded.  Please rename the file and upload again.";
        errorWithFile = true;
    }

    //Duplicate File Validation
    for (var fileindex in sender._uploadedFiles) {
        if (sender._uploadedFiles[fileindex].fileInfo.FileName == args.get_fileName()) {
            message = "You have already uploaded a file with the name " + args.get_fileName() + ". Please rename your new file and upload again.";
            errorWithFile = true;
            break;
        }
    }

    if (errorWithFile) {
        --filesSelected;
        args.set_cancel(true);
        sender._cancelUpload(args.get_row());
        sender._updateCancelButton(args.get_row());
        var index = $(args.get_row()).index();
        sender.deleteFileInputAt(index);
        sender.updateClientState();        
        alert(message);
    }
    MonitorFileUploadingQueue();
}

function onClientValidationFailed(sender, args) {
    var message = "";
    var errorWithFile = false;

    //File Extension Validation
    if (!sender.isExtensionValid(args.get_fileName())) {
        message = "File: " + args.get_fileName() + " selected has an invalid extension.";
        errorWithFile = true;
    }
    //MAX File Size
    else {
        message = "File: " + args.get_fileName() + " has exceeded the " + sender._maxFileSize / 1048576 + " MB file size limit.";
        errorWithFile = true;
    }

    if (errorWithFile) {
        debugger;
        --filesSelected;        
        var index = $(args.get_row()).index();
        sender.deleteFileInputAt(index);
        sender.updateClientState();
        
        alert(message);
    }

    MonitorFileUploadingQueue();
}

function MonitorFileUploadingQueue() {
    if (filesUploaded == filesSelected) {
        EnableDisableSubmitButton(true, "");
    }
    else {
        EnableDisableSubmitButton(false, "Uploading Files...");
    }
}

Thanks
Rakesh
Hristo Valyavicharski
Telerik team
 answered on 26 Aug 2014
1 answer
128 views
Hi Forum,

when I paste a text containing angle brackets, e. g. "test <test@domain.com>", into the auto complete box in token mode, both the text inside the brackets and the brackets themselves are not displayed:

"test <test@domain.com>" yields "test"

Anyhow, the brackets are still there, since I can access them via the "Text" property.

This behaviour can be reproduced with the Telerik demo on "http://demos.telerik.com/aspnet-ajax/autocompletebox/examples/default/defaultcs.aspx".

The texts inside the brackets should be displayed as well. How can I achive this?

Thanks for your help!

Roland
Nencho
Telerik team
 answered on 26 Aug 2014
9 answers
430 views
Hi,

I need to call javascript fxn on clicking "Save/Cancel/Close" button on Appointment EditForm. Currently, when I hit Save/Cancel button it  causes post back. How can I capture the client side event for these buttons? On clicking "X' on appointment edit form, it just closes the form, need to call javascript fxn on clicking close button.

Any idea?
Thanks
Prava
Bozhidar
Telerik team
 answered on 26 Aug 2014
1 answer
351 views
I have a radgrid in inline edit mode which has two raddatepicker in edit mode. when someone is typing some text that is not a date the datepicker will display an error sign inside the dateinput but when the person is clicking update button it updates the database by null. I want to cancel editing  when the error sign is in the inputdate box when the user click on update button. How can I do that?  my code is as below:
protected void ToolkitList_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem dataItem = (GridEditableItem)e.Item;
RadDatePicker pickerdue = (RadDatePicker)dataItem["ToolkitDueDate"].Controls[0];
pickerdue.ShowPopupOnFocus = true;
pickerdue.DatePopupButton.Visible = false;
pickerdue.Width = Unit.Pixel(80);


RadDatePicker pickerboard = (RadDatePicker)dataItem["BoardMeetingDate"].Controls[0];
pickerboard.ShowPopupOnFocus = true;
pickerboard.DatePopupButton.Visible = false;
pickerboard.Width = Unit.Pixel(80);


}

}

protected void ToolkitList_UpdateCommand(object sender, GridCommandEventArgs e)
{
try
{
if (e.CommandName == RadGrid.UpdateCommandName)
{
GridEditableItem editedItem = e.Item as GridEditableItem;


if (editedItem != null && editedItem.IsInEditMode)
{
                               
                        
                        int myUniqueId =
Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][" ID"]);
string labeloneText = string.Empty;
string labeltwoText = string.Empty;
RadDatePicker pickerdue = (RadDatePicker) editedItem["ToolkitDueDate"].Controls[0];
RadDatePicker pickerboard = (RadDatePicker) editedItem["BoardMeetingDate"].Controls[0];

if (!pickerdue.IsEmpty && !pickerboard.IsEmpty)
{

labeloneText = pickerdue.SelectedDate.ToString();
labeltwoText = pickerboard.SelectedDate.ToString();
bool success = _masterPage.ToolkitBo.UpdateDueandBoardDateForToolkit(myUniqueId,
Convert.ToDateTime(labeloneText), Convert.ToDateTime(labeltwoText),
_currentUser.FullName);

// Rebind the toolkit list to reflect the changes.
ToolkitList.Rebind();

// If it was not successful, throw an error.
if (!success)
{
throw new InvalidOperationException("Failed to add new due date.");
}
}

// Update the toolkit's due date.
if (pickerdue.IsEmpty && pickerboard.IsEmpty)
{

labeloneText = pickerdue.SelectedDate.ToString();
labeltwoText = pickerboard.SelectedDate.ToString();
bool success = _masterPage.ToolkitBo.UpdateDueandBoardDateForToolkit(myUniqueId,
null, null, _currentUser.FullName);

// Rebind the toolkit list to reflect the changes.
ToolkitList.Rebind();

// If it was not successful, throw an error.
if (!success)
{
throw new InvalidOperationException("Failed to add new due date.");
}
}

if (pickerdue.IsEmpty && !pickerboard.IsEmpty)
{
labeltwoText = pickerboard.SelectedDate.ToString();
bool success = _masterPage.ToolkitBo.UpdateDueandBoardDateForToolkit(myUniqueId,
null, Convert.ToDateTime(labeltwoText), _currentUser.FullName);

// Rebind the toolkit list to reflect the changes.
ToolkitList.Rebind();

// If it was not successful, throw an error.
if (!success)
{
throw new InvalidOperationException("Failed to add new due date.");
}
}
if (!pickerdue.IsEmpty && pickerboard.IsEmpty)
{
labeloneText = pickerdue.SelectedDate.ToString();
bool success = _masterPage.ToolkitBo.UpdateDueandBoardDateForToolkit(myUniqueId,
Convert.ToDateTime(labeloneText), null, _currentUser.FullName);

// Rebind the toolkit list to reflect the changes.
ToolkitList.Rebind();

// If it was not successful, throw an error.
if (!success)
{
throw new InvalidOperationException("Failed to add new due date.");
}
}
}
}

}
catch (Exception err)
{
                
 }
Princy
Top achievements
Rank 2
 answered on 26 Aug 2014
4 answers
552 views

For example

There is a radgrid whose width is 3000 px, and the resolution of my scree is 1920 * 1080.

Because of 1920 < 3000,  there is scroll bar in this radgrid.

This problem is that the grid's width is not set  (Means Auto? I guess...).

I tried to get value from RadGrid1Width but get nothing.

I also tried count all column width with loop like...

-----------------------------------------------------
double TotalSize = 0;

foreach (GridItem tmpIt in p_Grid.MasterTableView.Columns)
{
    TotalSize += tmpIt.Width.Value;
}
//TotalSize == 0.0
-----------------------------------------------------

How can I get 3000 px from the radgrid?

If I need to count all the column's width, what event I could use?

Thanks.
Princy
Top achievements
Rank 2
 answered on 26 Aug 2014
2 answers
180 views
I am using the sticky footer example and also a master page.  I have added a asp:panel inside a LayoutColumn which is in a LayoutRow and that of course is inside a RadPageLayout.

I can manually add the button and the panel to the ajax manager but the loading panel is never fired.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="ButtonContact">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PanelContactForm" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Glow" MinDisplayTime="5000">
        </telerik:RadAjaxLoadingPanel>

If I try to use the ajax config wizard then neither the button or the panel are available to me. How can I reference them so they are ajax-ed? I have tried multiple combinations of the following as well.

protected void Page_Load(object sender, EventArgs e)
       {
           Panel PanelContactForm1 = (Panel)PageLayoutMaster.FindControl("PanelContactForm");
           Button ButtonContact1 = (Button)PanelContactForm1.FindControl("ButtonContact");
           RadAjaxManager1.AjaxSettings.AddAjaxSetting(ButtonContact1, PanelContactForm1);
       }

Thanks, Marty



moegal
Top achievements
Rank 1
 answered on 25 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?