Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
91 views
Hi

While i was exporting the radgrid to excel and work export tool bar is also including. i want to avoid the export toolbar in excel sheet.
While i was using ExportOnlyData="true" that is not including. But in my case i have used linkbutton in the grid so if i use ExportOnlyData="true" link button value is also not including. Any other way to avoid export tool bar in excel.
Nithya Rani
Top achievements
Rank 1
 answered on 12 Jan 2012
1 answer
85 views
Hi all,
I want to place checkbox row in radgrid ..... with header also in checkbox to select and deselect rows... how can i do this plz help me to do this.....?????
Shinu
Top achievements
Rank 2
 answered on 12 Jan 2012
2 answers
87 views
Hi,
I want to disallow user from keying text in the combo box which contains checkbox. Because this will cause error to happen.
The error message is as below:



I have try to set AllowCustomText="false" but it seems that it do not take action when there is checkbox inside the combobox.
Below is is my sample code

<ajax:RadComboBox ID="DdlProject" runat="server" Width="240px" EnableLoadOnDemand="True" Text=" " AllowCustomText="false"
                           EnableVirtualScrolling="true" EnableAutomaticLoadOnDemand="true">
                           <ItemTemplate>
                               <asp:CheckBox runat="server" ID="chkProject" oncheckedchanged="chk_CheckedChangedProject" AutoPostBack="true"  Text='<%#Eval("ProjectName")%>' />
                           </ItemTemplate>
                       </ajax:RadComboBox>
 
 
dsProject = getGetProject(mstrCompNo)
 
           DdlProject.DataSource = dsProject
           DdlProject.DataTextField = "ProjectId"
           DdlProject.DataValueField = "ProjectName"
           DdlProject.DataBind()

Does anyone has any idea? Help Please!!
johnson lim
Top achievements
Rank 1
 answered on 12 Jan 2012
1 answer
78 views
Render Control does not create connecting lines in treeview.

Thanks
Tom Rozzi
Princy
Top achievements
Rank 2
 answered on 12 Jan 2012
3 answers
119 views
my radcombobox view is not right. Please check the following attachment.
i use telerik v.2011.1.315.35
Princy
Top achievements
Rank 2
 answered on 12 Jan 2012
1 answer
56 views
I just used a Hex Editor to check which version of jQuery was in the 2011-11-14 Telerik.Web.UI.dll that I'm using (v.2011.2.915.35).  It appears to be Version 1.5 of jQuery.

The jQuery website states that the latest version available is 1.7.1.

When do you plan to incorporate this into your DLL?

Robert
Iana Tsolova
Telerik team
 answered on 12 Jan 2012
1 answer
164 views
I want to have a textbox in my Grid ( not in Edit mode ) and it has integer values from my datasource, Is that possible that when user edit the value and go to another textbox, my datasource updated from code-behind?

Regards
Mazdak
Shinu
Top achievements
Rank 2
 answered on 12 Jan 2012
1 answer
75 views
Hi,

When we are exporting the Grid data to PDF, the content is overlapping. Attached the screen shot for your reference.

Below setting is used in the page .

 

 

rgdProduct.ExportSettings.ExportOnlyData = true;
 rgdProduct.ExportSettings.IgnorePaging = true;
 rgdProduct.ExportSettings.OpenInNewWindow = true;
   
<ExportSettings HideStructureColumns="true" IgnorePaging="true" ExportOnlyData="true"
                                                    FileName="Result" OpenInNewWindow="true">
                                                    <Pdf PageHeight="210mm" PageWidth="297mm" PageTitle="Product" DefaultFontFamily="Arial Unicode MS"
                                                        PageBottomMargin="20mm" PageTopMargin="20mm" PageLeftMargin="20mm" PageRightMargin="20mm" />
                                                </ExportSettings>
Shinu
Top achievements
Rank 2
 answered on 12 Jan 2012
3 answers
144 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
64 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?