Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
149 views
I have a grid with a combo box in a template column and a date-time column all rows in the grid are in edit mode so in order to display additional info i need to add an on-focus event to trigger the additional data display.

but it fails to trigger the event !! in on click it works fine ?
here is my code :
C#
    protected void RadGridTaskAssinging_ItemDataBound(object sender, GridItemEventArgs e)
    {
        for (int i = 0; i < RadGridTaskAssinging.PageSize; i++)
        {
            RadGridTaskAssinging.EditIndexes.Add(i);
        }
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem edititem = (GridEditableItem)e.Item;
            RadDatePicker dPicker = (RadDatePicker)edititem["New_REMINDER_DATE_TIME"].Controls[0];
            dPicker.Width = Unit.Pixel(150);
            dPicker.Attributes.Add("onfocus", "ClickMe(" + edititem.GetDataKeyValue("S_ORDER_NUM") + "," + edititem.GetDataKeyValue("ACTIVE_NO") + ");");

            RadComboBox RadComboBoxUser = edititem.FindControl("RadComboBoxUser") as RadComboBox;
            RadComboBoxUser.Attributes.Add("onfocus", "ClickMe(" + edititem.GetDataKeyValue("S_ORDER_NUM") + "," + edititem.GetDataKeyValue("ACTIVE_NO") + ");");
        }
    }

ASPX CODE
            <telerik:GridDateTimeColumn DataType="System.DateTime"
                                        DataField="New_REMINDER_DATE_TIME"
                                        HeaderText="Internal End Date"
                                        CurrentFilterFunction="EqualTo"
                                        AutoPostBackOnFilter="true"
                                        SortExpression="New_REMINDER_DATE_TIME"
                                        UniqueName="New_REMINDER_DATE_TIME"
                                        FilterControlWidth="150px"
                                        ReadOnly="False"
                                        PickerType="DateTimePicker">
                <ItemStyle Wrap="False"/>                                          
                <HeaderStyle Width="190px" />
            </telerik:GridDateTimeColumn>
            <telerik:GridTemplateColumn DataField="T_User.USER_NAME"
                                    HeaderText="Employee"
                                    GroupByExpression="T_User.USER_NAME"  
                                    SortExpression="T_User.USER_NAME"
                                    UniqueName="USER_NAME"
                                    FilterControlWidth="80px">
                                    <ItemTemplate>
                                        <%#DataBinder.Eval(Container.DataItem, "T_User.USER_NAME")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <telerik:RadComboBox ID="RadComboBoxUser"
                                                            runat="server"
                                                            ShowDropDownOnTextboxClick="false"
                                                            MarkFirstMatch="true"
                                                            AppendDataBoundItems="True"
                                                            Width="110px"
                                                            DataSourceID="LinqDataSourceUser"
                                                            DataTextField="USER_NAME"
                                                            DataValueField="USER_CODE"
                                                            SelectedValue='<%# Bind("USER_CODE")%>'>
                                        </telerik:RadComboBox>  
                                        <script type="text/javascript">
                                            function ClickMe(Order, Active) {
                                                var inputOrder = document.getElementById("<%= input_S_ORDER_NUM.ClientID%>");
                                                var inputActive = document.getElementById("<%= input_ACTIVE_NO.ClientID%>");
                                                inputOrder.value = Order;
                                                inputActive.value = Active;
                                                var button = document.getElementById("<%= ButtonUpdateDetailes.ClientID%>");
                                                button.disabled = false;
                                                button.focus();
                                                button.click();
                                            }                                                  
                                            </script>                                    
                                    </EditItemTemplate>
                <ItemStyle Wrap="False" />                                          
                <HeaderStyle Width="120px" />                                    
            </telerik:GridTemplateColumn>

<asp:ImageButton ID="ButtonUpdateDetalies" runat="server" Enabled="false"
    ImageUrl="~/Images/Empty.png" Visible="true" />

I found this post but it doesnt enable me to send parameters to the Javascript !!

Veli
Telerik team
 answered on 08 Jul 2010
6 answers
120 views
Hello everyone,
I'm currently writing a control that contains a RadPanelBar with several items and a menu. The idea is that when ever an item in the menu is clicked the content on the panel bar should dynamically change (clear and add new items). The problem is that when I make the ajax call and add the items to the panel bar it wont have the normal "animation" behavior and all the items are collapsed (never expand). Funny thing is that it does work on the first load of the page (default load, before clicking anything on the menu) and the method called on load and on the ajax call is exactly the same (just with different id). My guess is that after a page load some sort of js function is called to add events etc to the telerik controls and since this is not called after the ajax post back then it wont work properly...

Any work suggestions?

Thanks in advance!

Sergio
Nikolay Tsenkov
Telerik team
 answered on 08 Jul 2010
2 answers
335 views
Hi all,
I have a asp.net page with a Telerik Radgrid control with dynamically generated columns.
I cannot disable the filtering function on a column, even using the AllowFiltering option set to false.
I send you the C# code that generates the columns. There are many columns that are not visible, but editable in the edit form. I don't know whether this can affect the filtering function.
The shown column "Key Control" displays the filter even if I have disabled it. The filter doesn't even work.

this.RadGrid_Processes.MasterTableView.EditMode = GridEditMode.EditForms;

this.RadGrid_Processes.Width = Unit.Pixel(855);

if (controlState.Equals(STATE_NAVIGATING) || controlState.Equals(STATE_LINKING))
{
    this.pnlInstructions.Visible = true;
}
else
{
    this.pnlInstructions.Visible = false;
    this.lblInstructions.Text = "";
}

this.RadGrid_Processes.AllowFilteringByColumn = true;
this.RadGrid_Processes.MasterTableView.AllowFilteringByColumn = true;

boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Id";
boundColumn.HeaderText = "Id";
boundColumn.UniqueName = "Id";
boundColumn.Visible = false;
boundColumn.ReadOnly = true;

boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Code";
boundColumn.HeaderText = "Code";
boundColumn.SortExpression = "Code";
boundColumn.UniqueName = "Code";
boundColumn.HeaderStyle.Width = Unit.Pixel(90);

boundColumn.CurrentFilterValue = String.Empty;
boundColumn.ShowFilterIcon = false;
boundColumn.CurrentFilterFunction = GridKnownFunction.Contains;
boundColumn.AutoPostBackOnFilter = false;
boundColumn.FilterDelay = 1000;
boundColumn.FilterControlWidth = 80;
boundColumn.AllowFiltering = true;


boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Description";
boundColumn.HeaderText = "Description";
boundColumn.SortExpression = "Description";
boundColumn.UniqueName = "Description";
boundColumn.HeaderStyle.Width = Unit.Pixel(650);

boundColumn.CurrentFilterValue = String.Empty;
boundColumn.ShowFilterIcon = false;
boundColumn.CurrentFilterFunction = GridKnownFunction.Contains;
boundColumn.AutoPostBackOnFilter = false;
boundColumn.FilterDelay = 1000;
boundColumn.FilterControlWidth = 600;
boundColumn.AllowFiltering = true;

boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "TestMode";
boundColumn.HeaderText = "Test Mode";
boundColumn.SortExpression = "TestMode";
boundColumn.UniqueName = "TestMode";
boundColumn.Visible = false;
//boundColumn.AllowFiltering = false;

dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlType";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlType.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Type";
dropDownColumn.UniqueName = "Control Type";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(90);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;

dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_KeyControl";
dropDownColumn.DataSourceID = this.LinqDataSource_YesNo.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Key Control";
dropDownColumn.UniqueName = "KeyControl";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(70);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
//dropDownColumn.Visible = true;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.ShowFilterIcon = false;
boundColumn.AllowFiltering = false;                   

dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_Formalized";
dropDownColumn.DataSourceID = this.LinqDataSource_YesNo.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Formalized";
dropDownColumn.UniqueName = "Formalized";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(70);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;

dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlEvaluation";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlEvaluation.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Evaluation";
dropDownColumn.UniqueName = "ControlEvaluation";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(140);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;

dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlFrequency";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlFrequency.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Frequency";
dropDownColumn.UniqueName = "ControlFrequency";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(135);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;

this.RadGrid_Processes.MasterTableView.EditFormSettings.ColumnNumber = 2;
this.RadGrid_Processes.MasterTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.PushButton;

The telerik version I am currently using in Q3 2009 SP1. If it is a bug, is it solved in the newest version?

Thanks in advance.

Best regards,

Dario Zanelli
Dario Zanelli
Top achievements
Rank 1
 answered on 08 Jul 2010
1 answer
149 views
In grid edit panel I want to show/hide some control inside 2 "templatecolumn" and a checkbox  "checkboxcolumn":

<telerik:RadGrid ID="RadGridParametriConfigurazione" runat="server" EnableEmbeddedSkins="False"
                GridLines="None" Skin="MachinaWeb" AllowPaging="true" PageSize="15" AllowAutomaticUpdates="true"
                EnableAjaxSkinRendering="False" OnItemCommand="RadGridParametriConfigurazione_ItemCommand">
                <MasterTableView AutoGenerateColumns="False">
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="~/Images/ImagesGrid/Cancel.gif"
                            EditImageUrl="~/Images/ImagesGrid/Edit.gif" UpdateImageUrl="~/Images/ImagesGrid/Update.gif"
                            InsertImageUrl="~/Images/ImagesGrid/Update.gif" UniqueName="EditCommandColumn"
                            ItemStyle-Width="40px" />
                        <telerik:GridBoundColumn DataField="IdParametro" DataType="System.Int64" HeaderText="IdParametro"
                            SortExpression="IdParametro" UniqueName="IdParametro" ReadOnly="true" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="IdCultura" DataType="System.Int64" HeaderText="IdCultura"
                            SortExpression="IdCultura" UniqueName="IdCultura" ReadOnly="true" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DescrizioneParametro" HeaderText="DescrizioneParametro"
                            SortExpression="DescrizioneParametro" UniqueName="DescrizioneParametro" ReadOnly="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="Descrizione" UniqueName="TemplateColumnDescrizione">
                            <HeaderTemplate>
                                <asp:Label ID="LabelDescrizione" runat="server" Text="Descrizione"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="LabelDescrizione" runat="server" Text='<%# Bind("DescrizioneTextBox") %>' Width="250px"></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBoxDescrizione" runat="server" Text='<%# Bind("DescrizioneTextBox") %>' Width="250px"></asp:TextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="TemplateColumnValore" HeaderText="ValoreComboBox">
                            <HeaderTemplate>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="LabelComboBoxValore" runat="server" Text='<%# Bind("ValoreComboBox") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadComboBox ID="RadComboBoxValore" runat="server" Width="250px">
                                </telerik:RadComboBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridCheckBoxColumn DataField="Abilitato" HeaderText="Abilitato" SortExpression="Abilitato"
                            UniqueName="Abilitato">
                        </telerik:GridCheckBoxColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn>
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
            </telerik:RadGrid>

I tryed in ItemCommand with this code without success:

protected void RadGridParametriConfigurazione_ItemCommand(object source, GridCommandEventArgs e)
   {
       switch (e.CommandName)
       {
           case "Edit":
               GridEditableItem editedItem = (GridEditableItem)(e.Item);
               GridEditManager editMan = editedItem.EditManager;
               GridTemplateColumnEditor templateColumnValoreEditor = (GridTemplateColumnEditor)(editMan.GetColumnEditor("TemplateColumnValore"));
               GridTemplateColumnEditor templateColumnDescrizioneEditor = (GridTemplateColumnEditor)(editMan.GetColumnEditor("TemplateColumnDescrizione"));
               GridCheckBoxColumnEditor checkBoxColumnEditor = (GridCheckBoxColumnEditor)(editMan.GetColumnEditor("Abilitato"));
               checkBoxColumnEditor.ContainerControl.Controls[0].Visible = false;
               //templateColumnValoreEditor.ContainerControl.FindControl("RadComboBoxValore").Visible = false;
               break;
       }
   }

It seems I can only access fields in Item and not in EditTemplate. Why? How can I hide a control in edit?
Princy
Top achievements
Rank 2
 answered on 08 Jul 2010
1 answer
156 views

I want to hide/show by code some controls inside a radgrid's editform.

I have a radgrid. The user clicks on a row and the custom editform is showed because we are in edit mode. Inside this form I have some controls bounded with datasource data. How can I hide some controls by code?

I tried the ItemCommand event but it seems I cannot access the controls in edit :(

protected void RadGridParametriConfigurazione_ItemCommand(object source, GridCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "Edit":
                GridEditableItem editedItem = (GridEditableItem)(e.Item);
                GridEditManager editMan = editedItem.EditManager;
                GridTemplateColumnEditor templateColumnValoreEditor = (GridTemplateColumnEditor)(editMan.GetColumnEditor("TemplateColumnValore"));
                GridTemplateColumnEditor templateColumnDescrizioneEditor = (GridTemplateColumnEditor)(editMan.GetColumnEditor("TemplateColumnDescrizione"));
                GridCheckBoxColumnEditor checkBoxColumnEditor = (GridCheckBoxColumnEditor)(editMan.GetColumnEditor("Abilitato"));
  
                checkBoxColumnEditor.ContainerControl.Controls[0].Visible = false;   
                break;
        }
    }
}

How can I do this?
Shinu
Top achievements
Rank 2
 answered on 08 Jul 2010
3 answers
267 views
We are using 2008 Q3 version of Telerik controls we are facing this problem.

When we are trying to get the rad combo instance at client side on page load and it is not associated with any event like OnClientSelectedIndexChaged then we are not able to get the instance of the Rad Combo Box.We are using the following code block.
Where cboTerms is the Id of my control.

var cboEntityType = $find("<%= cboTerms.ClientID %>");

var item = cboEntityType.get_selectedItem();

var term = item.get_value();

can you suggest some way out for it, as the above code block is working fine when i use it in Selected Index change on client side.

Peter
Telerik team
 answered on 08 Jul 2010
1 answer
60 views
I am stuck on 2009.3.1503.35 because 2010 Q1 icon changed for insert/delete.
How do I make the icons look the old way without having to using a custom skin?
Dimo
Telerik team
 answered on 08 Jul 2010
1 answer
96 views
We are using usercontrol for AdvancedEditForm in the scheduler. We are able to bind the controls in the custom user control. But the edit form is not being displayed. We thoroughly followed the demos provided in the telerik. Any help is appreciated.

Thanks,
Vijaya Sankar Kolluri
Peter
Telerik team
 answered on 08 Jul 2010
3 answers
116 views
Hello,

I am working with Telerik v2.0.50727 and am facing a problem with the arrow position for a sub menu.
When the menu is displayed, the arrow is displayed on the text as showed in the printscreen. Once I get over the menu with the mouse, everything is displayed properly.

I tried to change the margin and padding  of the rmArrows and rmExpand classes without success. Is that a problem in my css? If yes, which css class do I have to use in order to have the arrow displayed properly ?

Thanks in advance for your answer.
.RadMenu_Default .rmGroup .rmLink {    
        padding-left: 0px !important;     
        padding-right: 4px !important;   
        padding-top: 0px !important; 
        padding-bottom: 0px !important; 
        background-color:#EEEEEE !important; 
     }    
         
    .RadMenu_Default .rmGroup .rmLink .rmText {    
        padding-left: 0px !important;  
        padding-right: 4px !important;   
        padding-top: 0px !important; 
        padding-bottom: 0px !important; 
     }  
      
     .RadMenu_Default .rmGroup  {   
     border: 0px solid #979797 !important;    
     background: #f0f0f0 !important;    
} 

Peter
Telerik team
 answered on 08 Jul 2010
5 answers
175 views
Hi,

   Barchart is taking time to load in webpage.  I have a data table of 100 records and i am binding that to barchart. Rendering is taking so long from bar chart.
Is there any method that i can fasten the barchart loading


Mike Treat
Top achievements
Rank 1
 answered on 08 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?