Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
1.9K+ views
Hi All,
Can I change RadGrid Headertext at runtime??
if yes how can I do that????


thanks
ghadeer
christian
Top achievements
Rank 1
 answered on 12 Dec 2011
1 answer
358 views
The bottom border of the last row in radgrid control is not showing whenever the grid is not fully filled.
Galin
Telerik team
 answered on 12 Dec 2011
1 answer
154 views
I am having a problem with a custom filter editor when DataKeyValue and DataTextValue differe.

Most of the code I am using was taken from the custom field editors demo.
Filtering the related grid works fine but the text field is showing the wrong text after a click on the "Apply" button.
If I click on "Add Expression" I get a filled combo box where I can select the order type by name.
Clicking on "Apply" filters the grids contents as expected. But the reacently added expression shows the integer value in it's text field.
I would like to show the localized text out of the combo box.

This is the filter extracted from the page.
   <telerik:RadFilter ID="Filter" runat="server" FilterContainerID="OrderListGrid"
        OnFieldEditorCreating="Filter_FieldEditorCreating"
       CssClass="RadFilter RadFilter_Default " >
      <FieldEditors>
      <csc:RadFilterDropDownEditor FieldName="Type" DataValueField="Type" DataTextField="Name" DataType="System.Int32" />
      <telerik:RadFilterTextFieldEditor FieldName="Order" DataType="System.String" />
      <telerik:RadFilterDateFieldEditor FieldName="Start" DataType="System.DateTime" />
      <telerik:RadFilterDateFieldEditor FieldName="End" DataType="System.DateTime" />
       </FieldEditors>
      </telerik:RadFilter>
OrderListGrid is a RadGrid using a sql data source to a simple table.
This table has a column "Type" which stores the order types as an integer value.
This integer value should not be shown to the customer, but replaced by a localized text within the filter combo box.
Therefore I've created a DataTable and assigned it to the custom filter editor as in the demo.
 
private void InitializeFilterCtrl()
{
     RadFilterDropDownEditor dropTypFilter = Filter.FieldEditors[0] as RadFilterDropDownEditor;
  if (OrderTypesTable == null)
  {
    OrderTypesTable = GetOrderTypeTable();
  }
  dropTypFilter.DataSource = OrderTypesTable;
}

private DataTable GetOrderTypeTable()
{
  DataTable tab = new DataTable();
  tab.Columns.Add("Type");
  tab.Columns.Add("Name");
  tab.Rows.Add( new object [] { (int)OrderType.Final, LocalizationUtils.GetOrderName(OrderType.Final) });
  tab.Rows.Add(new object[] { (int)OrderType.Intermediate, LocalizationUtils.GetOrderName(OrderType.Intermediate) });
  tab.Rows.Add(new object[] { (int)OrderType.Piece, LocalizationUtils.GetOrderName(OrderType.Piece) });<br>  tab.Rows.Add(new object[] { (int)OrderType.Batch, LocalizationUtils.GetOrderName(OrderType.Batch) });
  return tab;
}
 LocalizationUtils.GetOrderName(..) just returns the localized text out of the resources.

public class RadFilterDropDownEditor : RadFilterDataFieldEditor
{
    protected override void CopySettings(RadFilterDataFieldEditor baseEditor)
    {
        base.CopySettings(baseEditor);
        var editor = baseEditor as RadFilterDropDownEditor;
        if (editor != null)
        {
            DataSource = editor.DataSource;
            DataTextField = editor.DataTextField;
            DataValueField = editor.DataValueField;
        }
    }
 
    public override System.Collections.ArrayList ExtractValues()
    {
        ArrayList list = new ArrayList();
        list.Add(_combo.SelectedValue);
        return list;
    }
 
    public override void InitializeEditor(System.Web.UI.Control container)
    {
        _combo = new RadComboBox();
        _combo.ID = "MyCombo";
        _combo.DataTextField = DataTextField;
        _combo.DataValueField = DataValueField;
        _combo.DataSource = DataSource;          
        _combo.DataBind();
        container.Controls.Add(_combo);            
    }
 
    public override void SetEditorValues(System.Collections.ArrayList values)
    {
      if (values != null && values.Count > 0)
      {
        if (values[0] == null)
          return;
        var item = _combo.FindItemByValue(values[0].ToString());
        if (item != null)
          item.Selected = true;
      }
    }
 
    public string DataTextField
    {
        get
        {
            return (string)ViewState["DataTextField"] ?? string.Empty;
        }
        set
        {
            ViewState["DataTextField"] = value;
        }
    }
    public string DataValueField
    {
        get
        {
            return (string)ViewState["DataValueField"] ?? string.Empty;
        }
        set
        {
            ViewState["DataValueField"] = value;
        }
    }
    public DataTable DataSource
    {
        get
        {
            return (DataTable)ViewState["DataSource"] ?? new DataTable();
        }
        set
        {
            ViewState["DataSource"] = value;
        }
    }
 
    private RadComboBox _combo;
}

Any suggestions?

Antonio Stoilkov
Telerik team
 answered on 12 Dec 2011
5 answers
125 views
Please refer to the demo link below and do the following.

http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceheadertemplates/defaultcs.aspx

Set Grouping direction: Vertical
Select the Timeline View

As you can see, the formatting of the table cells and rows get all screwed up after just 2 resources. I am in currently in firefox. Is there a way to fix this. This has been an issue for a long time with the RadScheduler and I was wondering if it is ever going to be addressed. It is the only thing holding me back from using this control in my application. It seems to be a pretty standard piece of functionality since you can accomplish this horizontally.
Plamen
Telerik team
 answered on 12 Dec 2011
1 answer
153 views
Hello,

I have a radgrid on my form and several text and combo boxes.
My intent is to update related boxes as soon as radgrid selection changes.
For that I use RadAjaxManager and set relations like
<telerik:AjaxSetting AjaxControlID="rgMain">
           <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="rtbEmployeeName" />
               <telerik:AjaxUpdatedControl ControlID="cbEmployeeActive" />
               <telerik:AjaxUpdatedControl ControlID="rtbHomePhone" />
               <telerik:AjaxUpdatedControl ControlID="rtbMobilePhone" />
               <telerik:AjaxUpdatedControl ControlID="rcbPosition" />
           </UpdatedControls>
       </telerik:AjaxSetting>

After that I process SelectedIndexChanged event in code-behind and get updated controls on client side - everything is OK.

However, when I use paging or sorting built-in into Radgrid it again triggers the update of the controls. I only would like them to update on selection change, not on page change or sort.
Is there a way to filter which events of a master control should trigger ajax updates of related controls ?

Thanks for your attention.
Maria Ilieva
Telerik team
 answered on 12 Dec 2011
0 answers
49 views
Hi all,
 I have a requirement, where when there are multiple rows of tabs the default layout is like this.

Row1
Row2
Row3

But the for the layout should be

Row3
Row2
Row1

is this possible. Just reversing the datasource doesn't work as the row1 should be filled first then the row2 and then the row3.

Is this possible.

Thanks
thomos
Top achievements
Rank 1
 asked on 12 Dec 2011
3 answers
131 views
Dear Sir/Madam,

Here I am adding Ribbonbar, RibbonbarTab, RibbonbarGroup and RibbonbarButtons from codebehind. Now in output window I am getting somehow mess up situation for buttons in groups. Please assist me how to resize Ribbonbar Groups? Also please find attached image for better understanding.

Here Is my Code to add Ribbonbar.

RibbonBarTab objRibbonBarTab = new RibbonBarTab();
RibbonBarGroup objRibbonBarGroup = new RibbonBarGroup();
RibbonBarButton objRibbonBarButton = new RibbonBarButton();
foreach (AM am in objList)
{
    //Prepare tabs and add it to ribbon bar
    objRibbonBarTab = new RibbonBarTab();
    objRibbonBarTab.Text = am.DisplayName;
    objRibbonBarTab.ID = am.Action_Menu_ID.ToString();
    objRibbonBarTab.ToolTip = am.Description;
    objRadRibbonBar.Tabs.Add(objRibbonBarTab); //Adding Tab to RibbonBar
 
    //Add Groups to above tab
    if (ChildList.Count > 0)
    {
        foreach (Child objSingle in ChildList)
        {
            objRibbonBarGroup = new RibbonBarGroup();
            objRibbonBarGroup.EnableLauncher = true;
            objRibbonBarGroup.Text = objSingle.DisplayName;
            objRibbonBarGroup.ID = objSingle.ActionMenuChildID.ToString();
            objRibbonBarGroup.ToolTip = objSingle.Description;
            objRibbonBarTab.Groups.Add(objRibbonBarGroup); //Adding Groups to Tabs
 
            //Add RaButtons to above Groups
            if (objRadGroupsList.Count > 0)
            {
                foreach(Child objMap in objRadGroupsList)
                {
                    objRibbonBarButton = new RibbonBarButton();
                    objRibbonBarButton.Text = objMap.DisplayName;
                    objRibbonBarButton.ID = objMap.ActionMenuChildID.ToString();
                    objRibbonBarButton.ToolTip = objMap.Description;
                    objRibbonBarButton.Value = objMap.Name;
                     
                    switch(objMap.Size)
                    {
                        case "Large":
                            objRibbonBarButton.Size = RibbonBarItemSize.Large;
                            break;
                        case "Medium":
                            objRibbonBarButton.Size = RibbonBarItemSize.Medium;
                            break;
                        case "Small":
                            objRibbonBarButton.Size = RibbonBarItemSize.Small;
                            break;
                    }
 
                    RibbonBarItem objRibbonBarItem = objRibbonBarButton;
                    objRibbonBarGroup.Items.Add(objRibbonBarItem);
                }
            }
        }
    }
}
Kate
Telerik team
 answered on 12 Dec 2011
3 answers
72 views
Hi Telerik,
Can we have multi selection of rows and deselection of single selected row without using CTRL Key press.
Please provide the solution ASAP as it is urgent.
Sebastian
Telerik team
 answered on 12 Dec 2011
5 answers
463 views
I have a tabstrip/multipage which functions through client-side code. In other words, the pageviews are loaded up front and clicking on tabs switches the multipage instantaneously. However, I have one particular pageview that holds data which can take a while to load. I would like to have it so when  a user clicks on the associated tab, a loading panel appears and the tab click essentially does an ajax update. If I set Autopostback to true and "Aajxify" the entire tabstrip, then I lose the quick switching between the other tabs. I only want this one tab to perform a postback, while the others function normally. Is there a way to do this? I thought I could set autopostback to true, handle the tabselecting event and, if the tab is not the one in question, set_cancel(true). THis works to allow only one tab to postback, but then obviously the normal functioning of the other tabs doesn't work. All of the client-side functions for selecting a tab seem to raise the TabSelecting even, so I get an endless loop. Basically, if the clicked tab is not the special "postback" tab, I just want to select the right pageview and focus the tab. I can select the pageview client-side, but there doesn't seem to be a way of focusing the tab in this example. Tab.select, Tab.se_selected and Tabstrip.set_selectedindex all seem to raise the selecting event.
Dimitar Terziev
Telerik team
 answered on 12 Dec 2011
2 answers
96 views
Hi All,

I've seen that you can centre a formtemplate in a RadGrid (http://www.telerik.com/help/aspnet-ajax/grid-center-popup-edit-form.html
) but how do you do it with a RadTreeList?  

There doesn't appear to be the OnPopUpShowing event....

Any pointers?

Best Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 12 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?