Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
308 views
Hi,

I am using the RadGrid with RadFilter. I wanted to show only certain flter menu options. I found a code in the documentation and tried but I am getting an error 'findItemByValue(...) ' is null or not an object. The code is shown below. Does anyone have the same problems.

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

<script type="text/javascript">

 

function pageLoad(sender, args)

 

{

 

var filter = $find("<%=RadFilter1.ClientID %>");

 

 

var menu = filter.get_contextMenu();

 

menu.add_showing(FilterMenuShowing);

}

 

function FilterMenuShowing(sender, args)

 

{

 

var filter = $find("<%=RadFilter1.ClientID%>");

 

 

var currentExpandedItem = sender.get_attributes()._data.ItemHierarchyIndex;

 

 

var fieldName = filter._expressionItems[currentExpandedItem];

 

 

var allFields = filter._dataFields;

 

 

var dataType = null;

 

 

for (var i = 0, j = allFields.length; i < j; i++)

 

{

 

if (allFields[i].FieldName == fieldName)

 

{

dataType = allFields[i].DataType;

 

break;

 

}

}

 

 

switch (dataType)

 

{

 

case "System.Int32":

 

sender.findItemByValue(

"NotEqualTo").set_visible(false);

 

sender.findItemByValue(

"Between").set_visible(false);

 

sender.findItemByValue(

"NoBetween").set_visible(false);

 

sender.findItemByValue(

"IsNull").set_visible(false);

 

sender.findItemByValue(

"NotIsNull").set_visible(false);

 

 

break;

 

 

case "System.String":

 

sender.findItemByValue(

"DoesNotContain").set_visible(false);

 

sender.findItemByValue(

"NotEqualTo").set_visible(false);

 

sender.findItemByValue(

"GreaterThan").set_visible(false);

 

sender.findItemByValue(

"LeassThan").set_visible(false);

 

sender.findItemByValue(

"GreaterThanOrEqualTo").set_visible(false);

 

 

break;

 

 

case "System.DateTime":

 

sender.findItemByValue(

"NotEqualTo").set_visible(false);

 

sender.findItemByValue(

"Between").set_visible(false);

 

sender.findItemByValue(

"NoBetween").set_visible(false);

 

sender.findItemByValue(

"IsNull").set_visible(false);

 

sender.findItemByValue(

"NotIsNull").set_visible(false);

 

 

break;

 

}

}

 

</

 

script>

 

 

 

 

 

 

 

</telerik:RadCodeBlock>

 

Raji
Top achievements
Rank 1
 answered on 29 Jul 2011
5 answers
246 views
Hi,

I have a RadFilter on a page which has a RadGrid with data in it.  The data in the grid may or may not contain a " in it.
If you currently attempt to use the filter with "Contains" and " in the text box, the following javascript error is thrown:

Sys.WebForms.PageRequestManagerServerErrorException: Unterminated string literal

It is a requirement that I be able to use the filter to find data that has a " in it.

My version of Telerik dlls is: 2011.1.413.35 (Q1 2011) ASP.NET AJAX

In an attempt to solve this, I have tried to do a replace before the OnApplyExpressions event finishes with Replace("\"", "\\\"") however this yields the same error as above.  The thought behind this was that I could escape it so that the javascript would no longer end prematurely.

Any help would be appreciated.
Thanks
Raji
Top achievements
Rank 1
 answered on 29 Jul 2011
6 answers
192 views
I have a problem with the TimeLine view and Internet Explorer 9. The columns in the header is not matching the columns below in IE 9 (it works in compatibility mode). I have provided screenshots from IE9 using the standard mode and the compatibility mode, and the code used to create this bug.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="manager" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadScheduler ID="scheduler" runat="server" SelectedView="TimelineView"
            RowHeight="40px" DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start"
            DataEndField="End" >
            <TimelineView NumberOfSlots="24" SlotDuration="0:15" ColumnHeaderDateFormat="h tt"
                TimeLabelSpan="4" ShowInsertArea="false"  />
        </telerik:RadScheduler>
    </div>
    </form>
</body>
</html>
Joe
Top achievements
Rank 1
 answered on 29 Jul 2011
6 answers
127 views
Is there a way to change the visiblity of buttons within the CommandItemTemplate tag?  If so what does the code look like to access this property?

Please disregard this thread.  I figured it out. 



Pavlina
Telerik team
 answered on 29 Jul 2011
2 answers
538 views

I need to move selected items from a RadList box to two other listboxes depending upon which button a user clicks. I cannot use the built-in TransferToID because that will only handle one source and one target.

The RadListBox get populated with a databind on the first load ...

if (!Page.IsPostBack)

{

    RadListBox1.DataSource = dt;

    RadListBox1.DataValueField = "UserID";

    RadListBox1.DataTextField ="FullName";

     RadListBox1.DataBind();

}

 
When I try accessing the selected items during a button-click event I do NOT get any hits ... nothing shows up in the SelectedItems collection of the RadListBox.  How can I solve this problem ? 

Thanks.




protected void btnFindSelected_Click(object sender, EventArgs e)

{
StringBuilder sb = new StringBuilder();


foreach
(RadListBoxItem item in RadListBox1.SelectedItems)  
{

    sb.Append(item.Text);

        // THIS IS ALWAYS EMPTY NO MATTER HOW MANY ITEMS I SEE ON THE PAGE THAT AREA SELECTED
}

 

 

for (int i = 0; i < RadListBox1.Items.Count; i++)

{

if (RadListBox1.Items[i].Selected)

    {

    sb.Append(RadListBox1.Items[i].Text);

    }

 }

}

string thisList = sb.ToString();  
// THIS IS ALWAYS EMPTY NO MATTER HOW MANY ITEMS I SEE ON THE PAGE THAT ARE SELECTED

 

 

 

 NOTE:  I was able to get a similar version of this to work successfully in a new project ... so there must be something else affecting the original that I haven't spotted.

Steve
Top achievements
Rank 1
 answered on 29 Jul 2011
1 answer
77 views
Hi

I want to use "Grid / Persisting Grid Settings" feature and save in ASPNETDB.MDF.

I refered http://www.telerik.com/community/code-library/aspnet-ajax/grid/storing-multiple-grid-settings-in-database-via-profile.aspx
 and grid preference is  saving in database.

My Question
-------------------

In our application we have username and password and we maintain "username" in  session .

So if I refere the above url , it is saving the windows login id(select UserName from dbo.aspnet_Users)

But i want my  grid setting should be saved based on my user name(which is in session).

so next time if i login with username and password  , grid preference should load automatically


Regards,
Ramkumar


Maria Ilieva
Telerik team
 answered on 29 Jul 2011
0 answers
106 views

Hi

             I am uploading files to server from webpage. Here I am checking whether file exist or not in server if exist I would like to ask Confirmation message like ‘File already Exist on Server, do you want to Override, if YES I want to Override, if NO  I want to skip that file and go for next file.

Here I am using Telerik:RadUpload control to upload multiple files.

Can you please help me to solve this issue.

Suresh K
Top achievements
Rank 1
 asked on 29 Jul 2011
1 answer
99 views
I'm currently using Safari 5.1 on Windows 7 to test the AsyncUpload component both on my own website and the telerik demo site.  After selecting either 1 or multiple files it seems to have a chance of refreshing the page and losing the selected files.  In the case of my own upload page I require the user to be logged in and when it does the refresh it logs the person out.

Is this a known issue with Safari?  Is there anything I can do to keep it from happening?

Peter Filipov
Telerik team
 answered on 29 Jul 2011
1 answer
134 views
Hi All,
I have RadColorPicker Having Id="RadColorPicker1" and also Have a asp Label..
I have Question that once i select the color from RadColorPicked ; That should apply to Asp Label..
Please suggest me out..
I'm beginner of Telerik technology..
Slav
Telerik team
 answered on 29 Jul 2011
3 answers
125 views
Hello,

I'm looking at making a schedule/calendar for a hockey team website and would like to include 2 or 3 resources to add to any given event: Home Team (always set), Away Team and Venue. Additionally, I'd like a descriptor flag to indicate a Practice or Game

My Teams and Venues are held in two tables in the db. Assume I retrieve the data into List<Team> and List<Venue> lists.

Can someone please explain how I could dynamically add Teams and Venues to two resource lists in the AdvancedForm? Can I bind resources to the lists?

Thanks
Plamen
Telerik team
 answered on 29 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?