Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
84 views
I have a RadDatePicker attached to a RequiredFieldValidator as part of a Template column.

I want the validation to fire whenever the grid attempts to page.  Looks like, by default, this does not occur.  Even if the RadDatePicker is empty, the validation does not fire when I page the grid.

Is there anyway I can force this?

I attempted to respond to the OnCommand client event when it is of type "Page", force the validation.  

function grid_OnCommand(sender, eventArgs) {
                var c = eventArgs.get_commandName();
                if (c == "Page") {
                    if (!Page_ClientValidate()) {
                        eventArgs.set_cancel(true);
                    }
                }
            }

While the validation does fire and the grid's data does not refresh, the pager still moves to the next page.  The set_cancel does not seem to take effect fully when paging.

Any help would be greatly appreciated.
Robert
Top achievements
Rank 1
 answered on 18 Oct 2012
6 answers
442 views
Hello,

I'm trying to hide the command item section on a grid based on user preferences, something like this:

if(user has no access)
{
    grid.AllowAutomaticInserts = false;
    grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
    //also I perform some code to hide columns
}

I use PreRender event to execute it. Hiding columns works fine but I still get the CommandItem section on the top of the grid. However, if I click on "Add new record" link, that section disappears after postback, showing the grid the way I want it. This is fine, I mean the user can't add items, but I don't want him to see the option as available.

If I call Rebind() after the above code is executed, the command section goes away. That's fine but the DataBind event is called twice, a behavior I don't want.

Am using the right event (PreRender) to execute the code? 

One more thing, my grid is inside a RadDock.

Thanks
Ching Luo
Top achievements
Rank 1
 answered on 17 Oct 2012
1 answer
35 views
Hey,

I'm working with mvc and asp.net. I have a telerik grid with 10 columns. But I need the first 5 columns grouped under 1 header and the last 5

f.e.

Before christ   |  After christ
1  |2  |3  |4  |5  | 1 |2  |3  |4  |5


I already found this link:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/multicolumnheaders/defaultcs.aspx

But that is for an ajax grid and that is not what I need. I'm using a razor view. Anyone has any ideas?
Angel Petrov
Telerik team
 answered on 17 Oct 2012
1 answer
145 views

Hello everyone,

I need your help, i have 2 RadGrid which each depend on other grid.
Each grid can sort. But if i sort the first grid i lost the first row selected item and the second grid give me error of grid1 cant be null

So, i would like to know how i can set the focus on the last selected item or just focus on the first row?
I use VB.NET

I have tried sample i found here, and nothing change like 

RadGrid1.MasterTableView.Items(0).Selected = True

for now in my Page_Load to get the focus i use radgrod1.items(0).focus()
but it doesn't work on the SortCommand sub, i get a javascript error message

In this sub, i get a new DataSource and i rebind the radgrid.
I have tried RadGrid1.SelectedIndexes.Add(0) with my .focus and same JS error.

Thanks for your help.

Pavlina
Telerik team
 answered on 17 Oct 2012
1 answer
55 views
Hi,
I want to create a component with the following setup

  • RadGrid: In the FormTemplate I have multiple components:
  • RadTextBox: Allows to search a tree in search-as-you-type manner (via AJAX), continuously updating a 
  • RadTreeView: As soon as I click there I want to put the selected item (via AJAX) into a 
  • asp:Label (inside an asp:UpdatePanel) and return it to the RadGrid
  • There are other RadTextBox and RadTreeView elements in the form as well, allowing search-as-you type on different trees as well.

I've got the latter four working in a separate page, but have not yet succeeded to integrate with the RadGrid.

It seems that there is a problem with Ajaxified controls within all RadGrid FormTemplates: According to this post it is not possible to put individual AJAX-enabled components into any RadGrid form, right? (I am afraid it is no option for me to put all of these components into a combined AJAX control as I have to update all the contained components individually).

Is there any workaround for me?
Is the problem the same in RadComboBox popups?

Thanks for your help,
Jürgen
Pavlina
Telerik team
 answered on 17 Oct 2012
2 answers
750 views
I'm trying to get the ClientID of a RadGrid from a sender object in a javascript event.   I need to get the RadGrid from a filteritem keypress event.  How do I get that?

This is crude but I can get it like this:

                var RadGrid1 = $find(sender.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id);

Anybody got any idea how to get the uniquename from the sender object?
Darren
Top achievements
Rank 1
 answered on 17 Oct 2012
13 answers
231 views
Hi,

I am forming my grid cells by merging multiple rows as shown here :
http://www.telerik.com/community/forums/aspnet-ajax/grid/can-i-use-html-code-like-lt-td-rowsapn-2-gt-in-grid.aspx#1144543

I have different color for my alternate rows. But with the merged cell functionality the css is all mixed up as shown in the screen shot. Could you suggest how to put have the non-merged cells as the alternate row?
Galin
Telerik team
 answered on 17 Oct 2012
0 answers
86 views
I'm working with a simple handler derived from AsyncUpload handler, whose entire code is below. In this code, the attempt to read the temp file created by the call to base.Process() as an image fails intermittently. When this fails, the file exists, the file stream can be opened, but the FileStream.Length is 0. Is there any way to work around this? I would expect the temp file to be accessible after the call to base.Process(). If it helps, this appears to only happen after I have already uploaded a file within the last few minutes.

public class MyAsyncImageUpload : AsyncUploadHandler
{
    protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
    {
        var result =base.Process(file, context, configuration, tempFileName);
         
        int imageWidth = 0;
        int imageHeight = 0;
        var imageExists = File.Exists(context.Server.MapPath("~/App_Data/RadUploadTemp" + "/" + tempFileName));
        using (var fs = new FileStream(context.Server.MapPath("~/App_Data/RadUploadTemp" + "/" + tempFileName), FileMode.Open, FileAccess.Read))
        {
            var imageByteSize = fs.Length;
            using (var image = Image.FromStream(fs))
            {
                imageWidth = image.Size.Width;
                imageHeight = image.Size.Height;
            }
        }
 
           return result;
    }
}
  
JohnH
Top achievements
Rank 1
 asked on 17 Oct 2012
4 answers
188 views
Hello All, 

I am using a grid with 'GridClientSelectColumn' to display a column of checkboxes. Also this displays a checkbox on the header which is again useful to me. I want to call a javascript function on the individual checkboxes . I would also like to call another javascript function when the checkbox in header is checked\unchecked. 

I could not find any help about how to do this. It might be an easy thing and I am missing something .

Please advise.
Thanks in advance. 

Regards
Yogendra
Yogendra
Top achievements
Rank 1
 answered on 17 Oct 2012
5 answers
234 views

Hi,

I'm attempting to show the end user some feedback on the items they've checked in a combobox and I want to send the checkedItems to a ListBox underneath showing what the user has checked. I'm having no luck with what I am trying.

Something like this:

ListBox1.Items.Add(ComboBox.CheckedItems.ToString());
Nencho
Telerik team
 answered on 17 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?