Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
135 views
I have a Gridview that uses a RadComboBox with checkboxes enabled to choose an Approval code or multiple denial codes. 

I have a asp:checkbox in the grid up in the header as well as next to each RadComboBox control as an 'Approve All' function. It should work similar to the checkboxes in Gmail.
You asp:checkbox in the header, which should check each asp:checkbox next to the RadComboBox controls in each row, will also set each RadComboBox to have the Approve item checked for selection.
When you uncheck a asp:checkbox next to the RadComboBox, you only uncheck that RadComboBox, not all controls in all rows.

I was wanting to do this all client side but can't see the get the checkboxes in the RadComboBox to check or uncheck. Also, I don't know if they are checked clientside if they will be picked up serverside when I'm ready to submit the approvals.

The code is something like what follows:
UPDATED THE CODE - When I had typed this out, I was writing it from memory. I have now posted the code as I am using it. The alerts do come up when I check or uncheck the checkbox next to the RadComboBox.

$(checkBoxSelector).live('click', function () {
                var index = $(checkBoxSelector).index(this);
                var gridRow = $('#MainContent_QueueGrid > tbody > tr:eq(' + index + ')');
 
                if ($(this).is(":checked")) {
                    gridRow.find('.rcbCheckBox').each(function () {
                        if ($(this)[0].nextSibling.wholeText === 'Approve') {
                            $(this)[0].attr("checked", true);
                            alert("Checking the box");
                        }
                    });
                }
                else {
                    gridRow.find('.rcbCheckBox').each(function () {
                        if ($(this)[0].nextSibling.wholeText === 'Approve') {
                            $(this)[0].attr("checked", false);
                            alert("UNChecking the box");
                        }
                    });
                }
            });

I have tried every which way to check or uncheck the Approval code inside the RadComboBox and it is not working.
I can see the Approval checkbox element when I get to the if statement but am not able to set the attribute to checked.
I have tried attr('checked', true) along with every other way I can find.

I know that if the asp:checkboxes are selected I could evaluate the grid with those, but my issue is for user experience. If the Approve All is selected, all of the RadComboBoxes should show Approved as the selcted text as well as if they open the RadComboBox, they should we Approved checked and possibly all denial codes disabled.

Is this something that can be done?
With your help, if I am successful in setting it, will the checked status hold when evaluating the grid in code behind?


Any help is greatly appreciated.
Thanks in advance.


Angel Petrov
Telerik team
 answered on 22 Jan 2013
9 answers
231 views
Hello,

I've got a rad menu that has a subnode that is being populated from a webservice call. I need to have the node data be refreshed each time the menu is expanded, but it appears that the call is cached once the data is first loaded. I tried setting the persistloadondemanditems attribute to "false" but this doesn't seem to change the behavior. Is there any way to accomplish this?

Thanks,
Aaron
Tom
Top achievements
Rank 1
 answered on 22 Jan 2013
4 answers
144 views
I also posted this question on this thread: http://www.telerik.com/community/forums/aspnet-ajax/menu/prevent-expandmode-webservice-nodes-from-being-cached.aspx

I have a menu that is loaded on demand but I don't want to have the client cache the values - I want a call made each time to load the values when the menu is expanded.  I followed the example from the above thread and it works great when not using rounded corners.  However, when I turn on rounded corners, the second time the menu expands, the corners/borders are missing. 

It appears this happens any time I clear the collection of menu items.  Here is my js:

function mainMenuItemClosed(sender, eventArgs)   
            {  
                var item = eventArgs.get_item();  
                if (item)  
                {  
                    sender.trackChanges();  
                    item.get_items().clear();  
                    item.set_expandMode(Telerik.Web.UI.MenuItemExpandMode.WebService);  
                    item._itemsLoaded = false;  
                    sender.commitChanges();  
                }  
            } 
Tom
Top achievements
Rank 1
 answered on 22 Jan 2013
3 answers
155 views
The RadSpell control works fine when URL is the application server, but when the URL is the ACE load balancer, I get a javascript error "object expected" from URL http://xxx.com/xxx/ScriptResource.axd?xxxx.  Fiddler shows 504 receive failure on /xxx/ScriptResource.axd?xxx

This project is referencing the Telerik.Web.UI.dll 2012.2.731.35

Greg
Top achievements
Rank 1
 answered on 22 Jan 2013
0 answers
76 views
My issue is simple, the editform in RadScheduler is showing behind to other appointments, but this bug only happen in IE 8.0.7601.17514. I try to change the css, but I dont have clue to change this behavior. Please help me!! I can't change the version of IE because is the standard in all machines.

<InlineEditTemplate>
                <div class="rsCustomAppointmentContainer">
                    <span class="rsCustomAppointmentContainerInner">
                        <div style="float: left">
                            <asp:Label ID="Label4" runat="server" Text="Option:" CssClass="inline-label"></asp:Label>
                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("ID") %>'></asp:Label>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Subject") %>'></asp:Label>
                            <asp:LinkButton ID="LinkButtonOpt" runat="server" CommandName="Link" Text='more info ...'></asp:LinkButton>
                            <%--<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Subject") %>' TextMode="SingleLine"
                            ReadOnly="true"></asp:TextBox>--%>
                        </div>
                        <div style="float: left">
                            <asp:Label ID="Label2" runat="server" CssClass="inline-label">Initial Date:</asp:Label>
                            <telerik:RadDatePicker runat="server" ID="InitialDateRadDatePicker" SelectedDate='<%# Bind("Start") %>'
                                MinDate="1900-01-01" OnSelectedDateChanged="Initial_SelectedDateChanged">
                                <DatePopupButton Visible="True" />
                                <DateInput ID="DateInput2" runat="server" EmptyMessageStyle-CssClass="riError" EmptyMessage=" "
                                    EnableSingleInputRendering="false" />
                            </telerik:RadDatePicker>
                        </div>
                        <div style="float: left">
                            <telerik:RadNumericTextBox ID="job_durationTextBox" runat="server" Type="Number"
                                NumberFormat-DecimalDigits="0" MinValue="1" OnTextChanged="jobDuration_TextChanged"
                                Width="100%" Label="Duration:">
                            </telerik:RadNumericTextBox>
                        </div>
                        <div style="float: left">
                            <asp:Label ID="Label3" runat="server" CssClass="inline-label">Final Date:</asp:Label>
                            <telerik:RadDatePicker runat="server" ID="FinalDateRadDatePicker" SelectedDate='<%# Bind("End") %>'
                                MinDate="1900-01-01" OnSelectedDateChanged="Final_SelectedDateChanged">
                                <DatePopupButton Visible="True" />
                                <DateInput ID="DateInput1" runat="server" EmptyMessageStyle-CssClass="riError" EmptyMessage=" "
                                    EnableSingleInputRendering="false" />
                            </telerik:RadDatePicker>
                        </div>
                        <div style="float: left">
                            <span class="inline-label">Stage:</span>
                            <telerik:RadComboBox ID="StageAuxComboBox" runat="server" SelectedValue='<%# Bind("cvp_stage_id") %>'
                                DataSourceID="StageDataSource" DataTextField="cvp_stage_name" DataValueField="cvp_stage_id">
                            </telerik:RadComboBox>
                        </div>
                        <div>
                            <asp:Button ID="InsertButton" runat="server" CommandName="Update" Text="Update">
                            </asp:Button>
                            <asp:Button ID="InsertCancelButton" runat="server" CommandName="Cancel" Text="Cancel">
                            </asp:Button>
                        </div>
                    </span>
                </div>
            </InlineEditTemplate>

My css.

.noresults
{
    opacity: 0.4;
    filter:alpha(opacity=40); /* For IE8 and earlier */
}
     
.RadScheduler .rsCustomAppointmentContainerInner
{  
    display: block;
    padding: 2px 0 0 2px;
    z-index: 1000 !important;
}
.RadScheduler .rsCustomAppointmentContainerInner *
{
    position: relative;   
    z-index: 100 !important;
}
.rsCustomAppointmentContainer
{
    width: 100% !important;
    height: 100% !important;
     
}
 
.RadScheduler .rsAptEditSizingWrapper
{
    left:0px !important;
    top:0px !important;
     
}
 
.rsApt
{
    z-index: -1;
}
Carlos
Top achievements
Rank 1
 asked on 22 Jan 2013
3 answers
134 views
I am exporting my grid and it works fine, but there are a couple fileds i do not show on the grid as they are note fields and have a lot of characters and the viewstate would get massive, so I show them in a popup service on the grid.  however when they export the grid they want the notes to go with the export, how can I change the export to include the notes field when I do not pull into the original grid because it would be massive.

Is there a way to pull a seperate sql query for an alternate view just for export only that pulls the notes field then does rebinds real view.
Daniel
Telerik team
 answered on 22 Jan 2013
3 answers
850 views
Hi,
Export to csv modifies datetime data. DateTime column in my grid has data in following format""11/11/2011 1:50:51 PM
but after export it is modified to "11/11/2011 13:50:51".

How can I persist data on exporting/ modify it during  this event. I tried to use  "ExportCellFormatting" but it never fired for csv export.

Thanks,
Prava
Kostadin
Telerik team
 answered on 22 Jan 2013
3 answers
103 views
I am using RadAsyncUpload and cannot get it to work with more than one file.  

Basically, I'm using the FileUploaded event to save the file as a different filename (using a GUID) to ensure uniqueness.

This is what i am seeing (an example that I stepped through):

1. I upload two files on my form
2. After selecting the files and the status says they are complete, they are in the App_Data\Uploasd folder as:

fvcjn4uc.ls0
RadUploadTestFile
skhgx0p0.0at

3. I post the page

4. I step through and let it go through the first file, and it works, and I see that fvcjn4uc.ls0 is removed from App_Data\Uploads (e.g. only skhgx0p0.0at and RadUploadTestFile remains).

5. I then go through the next item in the foreach loop and it can access the filename and extension fine but when it does e.File.SaveAs(newFilename) I get (full path removed w/"HIDDEN"):

Could not find file 'C:\TFS\2010\[HIDDEN]\App_Data\Uploads\fvcjn4uc.ls0'.

But that's the filename of the FIRST file that was removed, why is it trying to access this again?
   
Code:


        protected void RadAsyncUploadAttachments_FileUploaded(object sender, FileUploadedEventArgs e)
        {
            try
            {
                foreach (UploadedFile newfile in RadAsyncUploadAttachments.UploadedFiles)
                {
                    if (newfile != null)
                    {
                        string originalFilename = newfile.FileName;
                        string filename = Guid.NewGuid().ToString() + newfile.GetExtension();
                        string newFilename = RadAsyncUploadAttachments.TargetFolder + @"\" + filename;

                        e.File.SaveAs(newFilename);
                    }
                }
            }

            catch (Exception ex)
            {
                log.Error(ex);
            }
        }      

What am I missing?

Thanks,

Dave
Dave
Top achievements
Rank 1
 answered on 22 Jan 2013
1 answer
66 views

This is probably a newbie question, and is perhaps more of a javascript general question than a Telerik specific one. However, I guess many Telerik-developers know the answer :-)

In many cases, we need to keep track of some kind of state in client:

var someState;
  
function SomeEventHandler() {
      someState = someState + 1;
}

In the code-behind, we hook-up the event to some Telerik event:
theRadGrid.ClientSettings.ClientEvents.OnRowClick = "SomeEventHandler";

This works, if there is only one "theRadGrid" on the page, but if there are multiple instances of the control, we have problem, since "someState" is shared across instances, it is global to the page.

What is the best way to make state variables local to the instance?

Hope I made myself understood :-)

/Fredrik
Angel Petrov
Telerik team
 answered on 22 Jan 2013
1 answer
55 views
Hi,

I am using Telerik RadAsyncUpload and trying to get the keyboard control using the demo URL. I am using 2011.2.915.40 version.

http://demos.telerik.com/aspnet-ajax/asyncupload/examples/keyboardsupport/defaultcs.aspx

I am using the same code given in the demo URL, but unable to get the focus on Select button on Tab key press. Please suggest me what I am missing in the attached code.

Thanks!
Abhinav
Plamen
Telerik team
 answered on 22 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?