Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
339 views
Hello,
I need to find at server side an EditItemTemplate control in a GridTemplateColumn when the data are loaded in a Grid.
The Grid EditMode is set to "Batch":
<MasterTableView GridLines="None" HorizontalAlign="NotSet" CommandItemDisplay="Top"
   EditMode="Batch" AutoGenerateColumns="False" AllowNaturalSort="false">
   <Columns>
                                                 
...............
                                                 
<telerik:GridTemplateColumn HeaderText="Values" UniqueName="Values" DataField="Values">
    <HeaderStyle HorizontalAlign="Center" Width="100px"></HeaderStyle>
    <ItemStyle HorizontalAlign="Center"></ItemStyle>
    <ItemTemplate>
        <%#Eval("Values")%>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadComboBox ID="cbxMyValues" runat="server" Width="80px" AllowCustomText="true" MarkFirstMatch="true" AutoCompleteSeparator=";">
        </telerik:RadComboBox>
    </EditItemTemplate>
</telerik:GridTemplateColumn>
..................
 </Columns>
</MasterTableView>
  
I need to reference the "cbxMyValues" RadComboBox control.
When the ItemDataBound event is fired this code doesn't work because the type of e.Item is "GridDataItem".:
If (TypeOf (e.Item) Is GridEditableItem) AndAlso (e.Item.IsInEditMode) Then
    Dim lgeiCurrent As GridEditableItem = CType(e.Item, GridEditableItem)
    Dim lobjRadComboBox As RadComboBox  = lgeiCurrent.FindControl("cbxMyValues")
End If

Please how can I get the RadComboBox object?
Thank you.

Eyup
Telerik team
 answered on 03 Dec 2014
5 answers
617 views
I'm trying to get a RadComboBox to reload when any of 5 .asp form elements in the page are changed.

For example, I have an asp textbox calender, which, if changed, I want to trigger a reload of a RadComboBox as a change of date changes availability of the options in the combobox.

Is there a simple way of doing this using, say the "onchange" function in the asp form element? Any assistance on the simplest method to achieve this would be welcome.

Thanks in advance.
Conor
Top achievements
Rank 1
 answered on 03 Dec 2014
1 answer
53 views
After updating to Q3 2014 (from Q2 SP1) the export in Excel has been broken for column width for code

// Size columns
t.Columns[column[ColumnIndexer.Base]].Width = 46;
t.Columns[column[ColumnIndexer.Day]].Width = 5.29;

It generates columns with width: 5.86 and 0.42

I could not find any breaking changes in the Q3 release notes, please advise.

Kostadin
Telerik team
 answered on 03 Dec 2014
3 answers
326 views
Hi,

I'm trying to load the information as a Gantt Chart. Because my data is not structure as the gantt task require, i'created a view with the suggested structure for the Tasks, (i don't know how to populate the dependencies). So my gantt view's structure looks like:
[ID] [int]
[ParentID] [int]
[OrderID] [int]
[Title] [ntext]
[Start] [datetime]
[End] [datetime]
[PercentComplete] [decimal]
[Summary] [bit]

Now, in my ganttPage.aspx 
<telerik:RadGantt runat="server" ID="GanttChart" Skin="Silk" ListWidth="400px" Height="350px" Width="1000px" SelectedView="WeekView" AutoGenerateColumns="false" WorkWeekStart="Monday" WorkWeekEnd="Friday">
    <Columns>
        <telerik:GanttBoundColumn DataField="Title" HeaderText="Attivita" DataType="String" UniqueName="Title" Width="150px" AllowEdit="false"></telerik:GanttBoundColumn>
        <telerik:GanttBoundColumn DataField="Start" HeaderText="Inizio" DataType="DateTime" UniqueName="Start" DataFormatString="dd/MM/yy" Width="65px" AllowEdit="false" />
        <telerik:GanttBoundColumn DataField="End" HeaderText="Fine" DataType="DateTime" UniqueName="End" DataFormatString="dd/MM/yy" Width="65px" AllowEdit="false" />
        <telerik:GanttBoundColumn DataField="PercentComplete" HeaderText="Completamento" DataType="Number" UniqueName="PercentComplete" Width="110px" AllowEdit="false" />
    </Columns>                               
    <DayView UserSelectable="true" SlotWidth="65px" DayHeaderDateFormat="ddd" TimeHeaderDateFormat="H:mm" />
    <WeekView UserSelectable="true" DayHeaderDateFormat="ddd" SlotWidth="65px" WeekHeaderDateFormat="ddd" />
    <YearView UserSelectable="true" MonthHeaderDateFormat="M" YearHeaderDateFormat="Y" SlotWidth="65px" />
    <MonthView UserSelectable="true" SlotWidth="65px" MonthHeaderDateFormat="M" WeekHeaderDateFormat="ddd M/dd" />
     
</telerik:RadGantt>


So i don't wanna use the declarative binding because i need more flexibility, The Xml provider will not solve my problem. And the data source... i can't make it work :S...  Would be great!

I also want to show multiple projects in my gantt chart, it's that possible?


help me please...

Thanks!!!
Bozhidar
Telerik team
 answered on 03 Dec 2014
2 answers
82 views
Hi,

I'm trying to show multiple projects in one RadGanttChart. It's that possible?

I've used an xmlProvider like:
<Projects>
  <Project>
    <Tasks>
      <Task>

But doesn't work.

Any Idea?

Thanks!!!
Richard
Top achievements
Rank 1
 answered on 03 Dec 2014
3 answers
199 views
<telerik:GridTemplateColumn>
                <ItemTemplate>
                    <asp:LinkButton ID="lnkb" runat="server" Text='<%# Eval("Count") %>' CommandName="Count""></asp:LinkButton>
                </ItemTemplate>
             </telerik:GridTemplateColumn>

When i export into word, its showing blank data column in word document.

any solution ?
Kostadin
Telerik team
 answered on 03 Dec 2014
1 answer
216 views
Hi,


$("#GanttContainer").height($(window).height());

var radGantt = $find('<%= RadGantt1.ClientID %>');
radGantt.set_height($(window).height());
radGantt.set_width($(window).width());

I have this code, it executes and changes accordingly intern _height and _width property but gantt chart itself is not resizing.
Bozhidar
Telerik team
 answered on 03 Dec 2014
4 answers
203 views
Hi,

I have been using IE 10.0.9200.17148.
The horizontal alignment problem occurs in IE while using RadNumericTextBox.
(In Chrome it works fine.)

I've created a script as follows.

aspx
<telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Height="100%" Width="100%" HorizontalAlign="NotSet" LoadingPanelID="baseLoadingPanel" OnAjaxRequest="RadAjaxPanel2_AjaxRequest">
    <asp:FormView ID="detailsView" runat="server" OnDataBound="detailsView_DataBound">
         <telerik:RadNumericTextBox ID="sphR" runat="server" Width="100%" DbValue='<%# Eval("sphR") %>' Number="0" ReadOnly="True">
         </telerik:RadNumericTextBox>
    </asp:FormView>
</telerik:RadAjaxPanel>

cs
protected void detailsView_DataBound(object sender, EventArgs e)
{
    FormView item = (FormView)sender;
 
    RadNumericTextBox c = ((RadNumericTextBox)item.FindControl("sphR"));
    c.Style.Add("text-align", "right");
    c.EnabledStyle.HorizontalAlign = HorizontalAlign.Right;
 }

It works when the first page is open, but it doesn't work with later DataBind.
Please detail symptoms with reference to the attached avi file.
(Here is not able to attach a zip file, it has changed the extension to gif.)

Thanks,
Yoongu
Yoongu
Top achievements
Rank 1
 answered on 03 Dec 2014
3 answers
357 views
I'm getting an exception System.ArgumentOutOfRangeException thrown in the ItemDataBound callback of a RadComboBox that is in a GridDropDownColumn; breaking on editableItem.GetDataKeyValue() after inserting an item.  Can someone explain what is going on and what I'm need to do to correct it?

I have a grid that is bound via OnNeedDataSource to a table. A second table is bound (in code) to a column, though disabling it still shows the problem.  Ultimately I'm trying to select the customer in the combo box to the current item, but if there isn't a customer then to select the first "No Customer" item.

<telerik:RadGrid runat="server" ID="Test_RadGrid" AutoGenerateColumns="false" AllowPaging="true"
    OnNeedDataSource="RadGrid_NeedDataSource" OnUpdateCommand="RadGrid_UpdateCommand"
    OnItemCreated="RadGrid_ItemCreated" OnDeleteCommand="RadGrid_DeleteCommand"
    OnInsertCommand="RadGrid_InsertCommand" OnItemDataBound="RadGrid_ItemDataBound">
    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="InPlace">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" />
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="true" ForceExtractValue="Always" ConvertEmptyStringToNull="true" />
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" />
            <telerik:GridDropDownColumn UniqueName="CustomerCombo" HeaderText="Customer" DropDownControlType="RadComboBox" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
    Test_RadGrid.DataSource = DataSource(); // linq to sql join statement
}

protected void RadGrid_ItemDataBound(object source, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem editableItem = e.Item as GridEditableItem;
 
        // ^---- At this point editableItem.KeyValues, in Watch window, says KeyValues threw an exception
        // of type System.ArgumentOutOfRangeException, but doesn't break
 
        GridEditManager editManager = editableItem.EditManager as GridEditManager;
        GridDropDownListColumnEditor editor = editManager.GetColumnEditor("CustomerCombo") as GridDropDownListColumnEditor;
 
        //editor.DataSource = Customer.DataSource();
        //editor.DataValueField = TestField.ID;
        //editor.DataTextField = TestField.Name;
        //editor.DataBind();
 
        RadComboBox combo = editableItem[TestField.CustomerCombo].Controls[0] as RadComboBox;
        combo.AppendDataBoundItems = true;
        combo.Items.Insert(0, new RadComboBoxItem("No customer selected", "0"));
 
        var ret = (int)editableItem.GetDataKeyValue("0"); //  <-- OutOfRangeException thown, debugger
    }



Peter
Top achievements
Rank 1
 answered on 02 Dec 2014
1 answer
258 views
Hi,

I have a complicated page but I created a simple ASP.NET page with the issue. I have telerik RadAsyncUpload control and a button inside an UpdatePanel as shown:
<asp:UpdatePanel ID="_updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
    ...
<telerik:RadAsyncUpload ID="fileUpload" runat="server" MaxFileInputsCount="1"  OnClientFilesSelected="fileUpload_ClientFilesSelected" /><br />        
    
<asp:Button ID="_saveNewFileButton" runat="server" OnClick="_saveNewFileButton_Click"<br>    Text="Save"/>
 
</ContentTemplate>
</asp:UpdatePanel>

When a file is selected I want to disable the _saveNewFileButton and change the text to "Please Wait for Attachment Upload..." but I can't seem to get hold of the button reference in javascript:

var FilesUpdateInterval = null;
 //Handles client side FilesSelected event for _newFileUploadButton.
 function fileUpload_ClientFilesSelected(sender, args) {
    //disable the click event for submit button during upload<
     var submitButton = $find('<%= _saveNewFileButton.ClientID %>');
     submitButton.set_text('Please Wait for Attachment Upload...');
     submitButton.set_readOnly(true);
     if (FilesUpdateInterval == null) {
         FilesUpdateInterval = setInterval(function () { FileCheckForUploadCompletion(); }, 500);
     }
 }


I am getting submitButton is null error. I tried putting this javascript code outside the updatepanel and inside ContentTemplate with same result. Obviously whatever I am doing is wrong. How do I get hold of the control that is in updatepanel in javascript? I appreciate any help.

Thanks,
Dana
Marin Bratanov
Telerik team
 answered on 02 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?