Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
156 views
Hi,

I have a menu and a tab strip on the page, the menu root is above the tab strip and the menu

I'm having a problem with z-indexes for radMenu and radTabStrip when the tab strip goes over the width of the window and shows the buttons to scroll left and right (next and previous arrows). When this happens, the radMenu shows under the Tab Strip and I need it to show above. I tried to play with z-index everywhere but had no luck.

However, when the tab strip do not have those scroll buttons, it works perfect, the menu shows above the tab strip.

Thanks for any help
Eduardo
Eduardo
Top achievements
Rank 1
 answered on 12 Jan 2012
1 answer
65 views

Ok-

Can anyone give me any insight into how the DynamicRadGrid Column Filters work?  Here is the scenario.
I am using DynamicData and the Telerik.Web.UI.DynamicRadGrid. 

I have created a custom class that inherits from ITemplate.   My Custom Template Class builds a RadComboBox using the MetaForeignKeyColumn passed to it.  In the Template Class I have also subscribed to the ComboBox.selectedIndexChanged Event and fire the Filter event passin a new Pair that contains the columnname and value to filter on.

/// <summary>
/// Summary description for ForeignKeyFilterTemplate
/// </summary>
public class DDForeignKeyFilterTemplate : ITemplate
{
    private MetaForeignKeyColumn _column;
    private RadComboBox _ddlb = new RadComboBox();
    private const string NullValueString = "[null]";
    private DSIWebDbDataContext _context;
    private string _filterColumnName = string.Empty;
 
    public DDForeignKeyFilterTemplate(MetaForeignKeyColumn MetaColumn)
    {
        _column = MetaColumn;
        _ddlb.Skin = "WebBlue";
        _ddlb.EnableViewState = true;
        _ddlb.AutoPostBack = true;
        _ddlb.AllowCustomText = false;
        _filterColumnName = _column.ForeignKeyNames[0];
    }
 
    #region ITemplate Members
 
    public void  InstantiateIn(Control container)
    {
        _ddlb.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(_ddlb_SelectedIndexChanged);
     
        if (_ddlb.Items.Count <= 0)
        {
            if (!_column.IsRequired)
                _ddlb.Items.Add(new RadComboBoxItem("[Not Set]"));
          
            PopulateListControl();
             
        }
 
        container.Controls.Add(_ddlb);
    }
 
    void _ddlb_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair(e.Text, _column.Name));
    }
 
    private void PopulateListControl()
    {
        _context = (DSIWebDbDataContext)_column.Table.CreateContext();
 
        string PrimaryKeyName = _column.ParentTable.PrimaryKeyColumns[0].Name;
        string DispalyColumnName = _column.ParentTable.DisplayColumn.Name;;
        string ParentTableName = _column.ParentTable.Name;
 
        _ddlb.DataValueField = PrimaryKeyName;
        _ddlb.DataTextField = DispalyColumnName;
 
        switch (ParentTableName)
        {
            case "Bookings":
                loadBookings();
                break;
            case "SiteLocations":
                loadSiteLocations();
                break;
            case "ContainerSizes":
                loadContainerSize();
                break;
            case "Drivers":
                loadDrivers();
                break;
            case "Carriers":
                loadCarriers();
                break;
            case "YardPositions":
                loadYardPositions();
                break;
            case "ContainerTypes":
                loadContainerTypes();
                break;
        }
    }
 
    private void loadBookings()
    {
        var results = _context.Bookings.Select(b => new idname() { id = b.booking_key.ToString(), name = b.Booking_Number });
         
        results.OrderBy(o => o.name);
 
        if (results.Count() > 0)
        {
            foreach (var item in results)
            {
                _ddlb.Items.Add(new RadComboBoxItem(item.name, item.id));
            }
        }
    }
 
    private void loadSiteLocations()
    {
        var results = _context.SiteLocations.Select(b => new idname() { id = b.ref_key.ToString(), name = b.Location });
 
        results.OrderBy(o => o.name);
 
        if (results.Count() > 0)
        {
            foreach (var item in results)
            {
                _ddlb.Items.Add(new RadComboBoxItem(item.name, item.id));
            }
        }
    }

 

 In the DynamicRadGrid Init Method I am creating a new instance of my Template Class and assigning it to the DynamicGridBoundColumn.FilterTemplate. 

DynamicGridBoundColumn gridColumn = new DynamicGridBoundColumn();
 
string fieldName = string.Empty;
string fieldAlias = string.Empty;
 
gridColumn.DataField = column.Name;
gridColumn.ConvertEmptyStringToNull = column.ConvertEmptyStringToNull;
gridColumn.DataFormatString = column.DataFormatString;
gridColumn.UIHint = column.UIHint;
 
gridColumn.HtmlEncode = column.HtmlEncode;
gridColumn.NullDisplayText = column.NullDisplayText;
gridColumn.ApplyFormatInEditMode = column.ApplyFormatInEditMode;
gridColumn.HeaderText = column.DisplayName.Replace("_"," ");
gridColumn.Resizable = true;
 
fieldAlias = column.DisplayName;
fieldAlias = fieldAlias.Replace("_", "");
 
//Set up grouping for ForeignKeyColumns
if (column is MetaForeignKeyColumn)
{
    fieldName = ((MetaForeignKeyColumn)column).ForeignKeyNames[0];
    gridColumn.FilterTemplate = new DDForeignKeyFilterTemplate(((MetaForeignKeyColumn)column));
    gridColumn.FilterListOptions = GridFilterListOptions.VaryByDataTypeAllowCustom;
}
else
{
    fieldName = column.Name;
    fieldAlias = column.DisplayName;
    gridColumn.FilterListOptions = GridFilterListOptions.VaryByDataType;
}
 
// Country [Country], count(Country) Items [Items] Group By Country
gridColumn.GroupByExpression = fieldName + " [" + fieldAlias + "], count(" + fieldName + ") Items [Items] Group By " + fieldName;
 
MasterTableView.Columns.Add(gridColumn);

This works great and I get the RadComboBox boxes with the appropriate ParentTable values as custom filter dropdowns in each column of the Grid.

The issue:
When i select a new value in the dropdowns, i am getting value not found error on the filter event.
I have tried to overload the DynamicGridBoundColumn both the GetCurrentFilterValueFromControl and the SetCurrentFilterValueToControl.

protected override string GetCurrentFilterValueFromControl(TableCell cell)
 {
     if (cell.Controls[0] is RadComboBox)
     {
         string currentValue = ((RadComboBox)cell.Controls[0]).SelectedItem.Text;
 
         this.CurrentFilterFunction = (currentValue != "" && currentValue != "empty ") ? GridKnownFunction.EqualTo : GridKnownFunction.NoFilter;
 
         return currentValue;
     }
     else
         return base.GetCurrentFilterValueFromControl(cell);
 }
 
 protected override void SetCurrentFilterValueToControl(TableCell cell)
 {
     if (cell.Controls[0] is RadComboBox)
     {
         if (!(this.CurrentFilterValue == ""))
         {
             ((RadComboBox)cell.Controls[0]).Items.FindItemByText(this.CurrentFilterValue).Selected = true;
         }
     }
     else
         base.SetCurrentFilterValueToControl(cell);
 }

I have even trapped the event in the Grid_ItemCommand Event setting the FilterExpression on the column and the MasterTableView.

#region Filter Items
if (e.CommandName == RadGrid.FilterCommandName)
{
    Pair filterPair = (Pair)e.CommandArgument;
    GridFilteringItem item = e.Item as GridFilteringItem;
 
    GridColumn filterColumn = item.OwnerTableView.GetColumn(filterPair.Second.ToString());
    filterColumn.CurrentFilterFunction = GridKnownFunction.EqualTo;
    filterColumn.CurrentFilterValue = filterPair.First.ToString();
 
    RadGrid1.MasterTableView.FilterExpression = filterColumn.EvaluateFilterExpression(item);
     
}
#endregion

I'm not sure if there is something i am missing.  The underlying column that i am trying to filter is a DynamicControl and is a ForeignKey so the values of the drid are actually the DisplayName of the parent table.  At one point i was getting a datatype miss-match as the comparer was trying to filter the EntityName (SiteLocation) to a string, which was the value (key) selected in the dropdown from the parrent table.

Any Ideas or help would be appreciated.
Thanks
Paul

PAUL
Top achievements
Rank 1
 answered on 11 Jan 2012
18 answers
231 views
Please take a look at the enclosed screenshot.  Notice that the 3rd item (in blue) in the RadListBox has been previously selected (via a traditional left-click).  But then the user chose to go to the 7th item (in yellow) and right click there.  Ideally what I'd want to happen, if the user chooses a valid menu item, is for this 7th item to be processed instead of the 3rd.  In other words, if the user chooses "Move Muck" in the Context Menu then I'd first want the 7th item in the RadListBox to be selected.

But, search as I might, I could not find out where to detect that the Context Menu was hovered above the 7th item.

How would I resolve this?

Robert
Robert
Top achievements
Rank 1
 answered on 11 Jan 2012
0 answers
97 views
Hello -
I am fairly new to all of this.  My RadGrid works as expected when I debug with the VS Debug Server, but when I publish to IIS and browse the page, the grid renders but does not respond to clicks. (No paging, no expanding, no filtering, etc.).  It may be something obvious I am missing.   

I am also using a masterpage, and I am wondering if the issue lies here?  I don't understand why something would work in the VS Debug Server and not on IIS. 

Thanks so much,
Kaveh

Edit:
I found this post: 
http://www.telerik.com/community/forums/aspnet-ajax/grid/sys-webforms-pagerequestmanagerservererrorexception-error.aspx 

Which is the same problem I am having.  Using the full URL seems to fix it.  
Kaveh
Top achievements
Rank 1
 asked on 11 Jan 2012
5 answers
124 views

I've an editable RadGrid which on edit shows a custom user control as a pop-up. The grid was embedded in an update panel and the user control used jQuery Validation plugin for validating the inputs.

I was facing issues with displaying the wait panel during ajax calls. To resolve this I removed the update panel and implemented RadAjaxManager following which the wait panel is functioning perfectly. But that broke the jQuery Validation plugin functionality. What I understand is that RadAjaxManager handles the ajax requests and doesnt trigger the events that the validation plugin is hooked to.

Is there any way of getting RadGrid + RadAjaxManager + jQuery Validation Plugin working. I do not want to do old-school way of placing custom validation code as there is extensive validation implemented using the validation plugin. Any workaround to get this working would be greatly appreciated.

Thanks in advance.

Regards.

Tsvetoslav
Telerik team
 answered on 11 Jan 2012
0 answers
97 views
Edited: Problem resolved.
It was due to inconsistent html encoding of Value/Text in different places. &, <, > are all well supported.
 

Hello,
 
We came across a (maybe) problem with the combo item value property:

- Add an item with something like "abc > xyz" in the Value property
- Select the item in the combo. The combo SelectedValue will return "".
- Html encoding the value does not (strangely) work neither

For your information: We set the value property of items in the RadCombo1_ItemDataBound event, like this: 
protected void RadCombo1_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
{
			dynamic data = e.Item.DataItem;
			e.Item.Text = data.MyText;
			//e.Item.Value = data.MyCode;
}

Would you please let me know if there is a workaround (other than removing html entities from values). We can wait for a future fix.

Thank you,
Stephan
Stephan
Top achievements
Rank 1
 asked on 11 Jan 2012
1 answer
192 views
Hello,
We have used RadFileExplorer control in our CMS. First problem we faced when number of files increases on the production server, FileExplorer become very much slow. In order to overcome this problem, We have implemented Custom FileSytem Content provider. In which we have manually populated the tree. After using that speed / performance has become incredibly improved. 

But after that there is another problem arises, if any folder in the root level or deep in the hierarchy contains files or folder more than 10,000 to 13000, that particular root directory did not open and its giving the error

"Error during serialization and deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property."  

I know this error is occurring due to the size of the response data become greater than the value for maxJsonLength property. Even when i have set the MAXIMUM value for this property in Web.Config, it had no effect. 

I thought that it was the problem with my implementation of Custom Content Provider, but when i remove my Custom Provider the problem and this error was still there.

I have also tried by setting AllowPaging Property to "True", But AllowPaging property can only work with Grid not with Tree.

I seems that FileExplorer is not meant for dealing with situations, when file hierarchy and the number of files become very large in number.

I was thinking to customize the behavior of FileExplorer that it should not returned the Ajax Response using JSON, Remember, when we click on tree node in the tree view of file explorer, by default Ajax request is sent to server and get the data back in the form of JSON string. If there is a way that we can disable this Asynchronous call and execute postback then I think this issue can be solved but I dont know how and in which client side method this call can be sent. Please help me in this regards.

Or suggest any better option to deal with if the number of files has become very large.

Thank you very much and have a nice day

Eman Ali Mughal


Dobromir
Telerik team
 answered on 11 Jan 2012
1 answer
97 views
Hi there,

I'm performing a manual postback therefore i can't use RadAjaxManager to register
the postback.

I want to see the ajax loading panel when i'm performing this manual postback.

Please advice.

Thank you.

Regards,
Dexter
Troy
Top achievements
Rank 1
 answered on 11 Jan 2012
2 answers
50 views
In our app we use a Radtreeview inside a Radcombobox with other controls (combo boxes, Check boxes, slider)

In the AJAX each control is set up as a Ajax control with its Update controls, This section is very large.

To reduce the code I have enclosed all these in a panel control, and have the panel update itself. This nearly works.

The only thing that doesn't work is the Treeview in the Radcombo box, when a selection is made, the correct ID is passed back to the code behind, but the display (the text that appears in the combo box, is NOT updated. I think this is done on the client.

I do have the PageLoad java script to persists the display value across postbacks.

Does anyone have any ideas.

Andy
Andy Green
Top achievements
Rank 2
 answered on 11 Jan 2012
3 answers
93 views
I have a grid with detail table. When I click Edit on a detail table, all rows go into edit mode and everything is nice and peachy. In edit mode, I also display a button for user to add a copy of the item with some values predefined. The problem is when add button is clicked and new item is created in datasource and then OwnerTableView is data bound (so that new item appears in the grid, sorted) in the callback my command items go into non-edit mode even though the grid still appears in edit mode. Any ideas what might be causing that?

Dom
Dom
Top achievements
Rank 1
 answered on 11 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?