Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
176 views
I am following the demo here for the related ComboBoxes and have a couple questions.

Related ComboBox Demo

But I need it to expand to do the following.
  1. On Page_Load doing an edit where I have the continent and country already saved in the database how do I load it?
  2. When I select on the city and press Explore the city is not being passed correctly.  It is always sending the intial load city not the on selected. 

Your help is appreciated.
Thank You!

Kalina
Telerik team
 answered on 19 Oct 2012
1 answer
93 views
A very simple use of RAD combo:

Datasource provides a list of values to load the combo box. Plain-vanilla VB.Net code.

This combo box is used in an edit form, and the selected value is set when the record to be edited is read from the SQL Server database.

We are not using any type of binding.

So, when I attempt to initialize the combo when the page loads, I find that I have a value in the database that triggers an error that is not trapped by a traditional Try / Catch construct. (see attachment)

In this particular example, the code found in the database did not match any value in the datasource for this combo and I get a hard, untrapped error on the selected value assignment. ("selection out of range")

I am hoping that I am doing something really stupid and overlooking an obvious solution, anybody care to show me my error?

 

    type_code = reader("type_code").ToString
Try
    Me.Type_Code_Combo.SelectedValue = type_code
Catch ex As Exception
    ' just ignore if there is no match
End Try

 

 Note: I am aware that I can set "allow custom text" but that is not the intent, rather to insulate my page from data errors, and allow for corrections by setting the selected value to nothing and letting the user make a proper selection. But if that is the only way, how to I synchronize so that the text in the box matches the selectedvalue in the list?

 

Nencho
Telerik team
 answered on 19 Oct 2012
1 answer
119 views
Hi!!..
I need replace the Name of items draping by an icon!...

I did on Grid but I couldn't do in RadListbox.

OnDrapping="ShowIcon"

function ShowIcon(sender,args){

  var row = sender._draggedRow; --> this is not correct


    row.innerHTML = "<img  src='/UI/Images/user_transfer.png' />";
    row.style.width = 0 + "px";
    row.style.height = 0 + "px";
}


How i can do this?
July
Top achievements
Rank 2
 answered on 19 Oct 2012
6 answers
227 views
Hello everyone,

I'm trying to use Server snippets incrusted in HTML with no luck. The code is as follows:

<label for="<%= myTextBox.ClientID %>" >Text</label>
<asp:TextBox id="myTextBox" runat="server />

The server throws me the following exception:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

I know I have to use RadScriptBlock if I want to use it in javascript, but how can I achieve this behavior with Telerik?
I also know that Telerik:RadTextBox contains a label option, but I need it this way because I'm using a CSS template.

in advance, thanks

Gabriel
Top achievements
Rank 2
 answered on 19 Oct 2012
1 answer
465 views
Hi,
I am retrieving a set of records from database and binding it to a RadGrid. I have applied Grouping to all the columns. When i am dragging a Column to group area it is making a group by the result set with respect to that column. In group footer it is displaying the Aggregate value (say Sum). Some of these column group totals are depends upon the other column total. For example My RadGrid has 4 columns.
Column 1: Product Name
Column 2: Quantity
Column 3: Price
Column 4: Percentage

The for Column 2 and Column 3 "Aggregate=Sum".
When I will drag the Column 1 the grid automatically groups the data as per product name and the group total is displaying for column 2 and column 3. 

For Column 4 Subtotal I have a Formula like (Sum(Column 2) / Sum(Column 3) ) *100.

How I can the Column 4 Subtotal for group level?
Please help.


Thanks 
Raj
Angel Petrov
Telerik team
 answered on 19 Oct 2012
1 answer
151 views


Hi,

I have created custom grid using item template grid .and have set show header to false.
however ,when I export i get to see header and no data which i want vice-versa ie:want ot show data and no header.


below is my code


<table width="100%" style="padding: 0px 30px 0px 30px">
        <tr style="padding-bottom: 10px;">
            <th style="background-color: #4C4C4C; margin-bottom: 30px; color: White; font-size: 13px;
                height: 25px; font-weight: bold" colspan="2">
                <div style="text-align: left; float: left; width: 20%">
                    Vacation Request
                </div>
                <div style="text-align: right; float: left; width: 80%">
                    <asp:ImageButton ID="imgexcel" runat="server" ImageUrl="~/Img/Export to excel.gif"
                        OnClick="imgexcel_Click" />
                    &nbsp;
                    <asp:ImageButton ID="imgword" runat="server" ImageUrl="~/Img/ExportToWord.gif" OnClick="imgword_Click" />
                    &nbsp;
                    <asp:ImageButton ID="imgpdf" runat="server" ImageUrl="~/Img/ExportToPDF.gif" OnClick="imgpdf_Click" />
                    &nbsp;
                    <asp:ImageButton ID="imgcsv" ImageUrl="~/Img/ExportToCSV.gif" runat="server" OnClick="imgcsv_Click" />
                </div>
            </th>
        </tr>
    </table>
    <table width="100%" style="padding: 0px 30px 0px 30px">
        <tr style="padding-bottom: 10px;">
            <td>
                <telerik:RadGrid ID="RadGrid1" runat="server">
                    <ExportSettings ExportOnlyData="true" FileName="VacationDetailReport" IgnorePaging="true"
                        OpenInNewWindow="true" HideStructureColumns="true" />
                    <MasterTableView TableLayout="Fixed" ShowHeader="false">
                        <CommandItemTemplate>
                        </CommandItemTemplate>
                        <ItemTemplate>
                            <table width="100%" style="padding: 0px 30px 0px 30px">
                                <tr>
                                    <td class="td1" width="20%" style="padding-top: 20px;">
                                        Consultant :
                                    </td>
                                    <td class="td2" style="padding-left: 6px">
                                        <asp:Label ID="lblConsultant" runat="server" Text='<%#Eval("name") %>' Font-Bold="true"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td1">
                                        Start Date :
                                    </td>
                                    <td class="td2" style="padding-left: 6px">
                                        <asp:Label ID="lblstartdate" runat="server" Font-Bold="true" Text='<%#Eval("StartDate") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td1">
                                        End Date :
                                    </td>
                                    <td class="td2" style="padding-left: 6px">
                                        <asp:Label ID="lblEnddate" runat="server" Font-Bold="true" Text='<%#Eval("EndDate") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td1">
                                        Type Of Leave :
                                    </td>
                                    <td class="td2" style="padding-left: 6px">
                                        <asp:Label ID="lblTypeofLeave" runat="server" Font-Bold="true" Text='<%#Eval("TypeOfLeave") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td1">
                                        Additional Comments :
                                    </td>
                                    <td class="td2">
                                        <asp:Label ID="lblAdditionalComments" runat="server" Font-Bold="true" Text='<%#Eval("AdditionalComments") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td1">
                                        Manager :
                                    </td>
                                    <td class="td2" style="padding-left: 6px">
                                        <%-- <asp:Label ID="lblManager" runat="server" Font-Bold="true" Text='<%Eval("") %>'></asp:Label>--%>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td1">
                                        Emergency Contact Info :
                                    </td>
                                    <td class="td2">
                                        <asp:Label ID="LblEmergencyContactInfo" runat="server" Font-Bold="true" Text='<%#Eval("EmergencyContactInfo") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right; padding-right: 5px; padding-top: 10px">
                                    </td>
                                    <td style="text-align: left; padding-left: 5px; padding-top: 10px">
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </MasterTableView>
                </telerik:RadGrid>
            </td>
        </tr>
    </table>
Kostadin
Telerik team
 answered on 19 Oct 2012
4 answers
216 views
Hello

I'm having a problem with grouping in the grid.
The data source is a List, the list itens contains another List, I want to group by the first item in this list (TestList[0].DescTest).
Putting the TestList[0].DescTest as DataField, the field is normally displayed, and can also be sorted, but when grouping the following error occurs:
Field definition is not valid. FieldName contains invalid characters: TestList[0].DescTest

I tried several other ways, but could not solve my problem.

public class TestInfo
{
    public int IDTest { get; set; }
     public string DescTest { get; set; }
     public List<TestInfo> TestList { get; set; }
}

<telerik:RadGrid ID="rgd_grid" runat="server" ShowGroupPanel="true" EnableHeaderContextMenu="True" EnableAJAX="True"
  OnNeedDataSource="rgd_grid_NeedDataSource">
    <ClientSettings ReorderColumnsOnClient="true" AllowGroupExpandCollapse="true" AllowDragToGroup="true" AllowColumnsReorder="true" AllowAutoScrollOnDragDrop="false" AllowExpandCollapse="false">
        <Selecting AllowRowSelect="false"/>
    </ClientSettings>
    <GroupingSettings ShowUnGroupButton="True" />
    <MasterTableView Summary="RadGrid table" Width="100%" DataKeyNames="IDTest" Name="Test">
        <Columns>
            <telerik:GridBoundColumn UniqueName="IDTest" DataField="IDTest" HeaderText="IDTest" Groupable="True">
                </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="DescTest" DataField="DescTest" HeaderText="DescTest" Groupable="True">
                </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="GroupTest" DataField="TestList[0].DescTest" HeaderText="GroupTest" Groupable="True">
                </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

private List<TestInfo> CreateDataSource()
{
    List<TestInfo> list = new List<TestInfo>();
 
    list.Add(new TestInfo());
    list[0].IDTest = 1;
    list[0].DescTest = "Test 1";
    list[0].TestList = new List<TestInfo>();
    list[0].TestList.Add(new TestInfo());
    list[0].TestList[0].DescTest = "Group 1";
 
    list.Add(new TestInfo());
    list[1].IDTest = 2;
    list[1].DescTest = "Test 2";
    list[1].TestList = new List<TestInfo>();
    list[1].TestList.Add(new TestInfo());
    list[1].TestList[0].DescTest = "Group 2";
 
    list.Add(new TestInfo());
    list[2].IDTest = 3;
    list[2].DescTest = "Test 3";
    list[2].TestList = new List<TestInfo>();
    list[2].TestList.Add(new TestInfo());
    list[2].TestList[0].DescTest = "Group 3";
 
    return list;
}
 
protected void rgd_grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    rgd_grid.DataSource = CreateDataSource();
}

Vasil
Telerik team
 answered on 19 Oct 2012
1 answer
104 views
January                                                                                                                    
S   M   T   W   T   F   S   S   M   T   W   T   F   S   S   M   T   W   T   F   S   S   M   T   W   T   F   S   S   M   T
1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31
                                                                                                                         
                                                                                                                         
                                                                                                                         
                                                                                                                         
                                                                                                                         
                                                                                                                         
                                                                                                                       
Hi i am trying to make multi view calender but i am not getting the correct format.
in this month is not coming in correct.
Here is my code :
<telerik:RadCalendar ID="rd1" runat="server" Orientation="RenderInRows"
        SingleViewRows="1" MultiViewRows="4" MultiViewColumns="3" FocusedDate="1/1/2012 12:00:00 AM"
        SingleViewColumns="30" SingleViewHeight="50" Height="500px">
    </telerik:RadCalendar>
Below is image.
Thanks
Angel Petrov
Telerik team
 answered on 19 Oct 2012
1 answer
84 views
We have developed an individual mobile version for a CRM system, but after integrated into the web version of CRM (a detection statement will detect and redirect to the mobile version if the request is from a mobile device), all the telerik controls didn't work. And funny things is, if we change telerik control to normal asp, it worked. Also, if we get rid of detection part, and access the mobile version directly, it still doesn't work. But if we accessed the web version first, then access the mobile version, all telerik controls work. Did anyone encounter the same problem? And does anyone know the solution for this? Thanks.
Marin
Telerik team
 answered on 19 Oct 2012
3 answers
118 views
I was wondering if there is some "easy" workaround to obtain this... let me explain.
At the moment you place the "final" controls in docks and place docks in the zones in the page and save.
This way you have to work on the actual page and you should be able to save each control setting in each dock as well, let's say for example if you want to dispaly 4 or 8 or 16 news items in a news control.
I was wondering if it's possible to have a "fake" page (a sort of edit page and not the final rendered one) where you move docks placeholders of the real controls for the real page, and in each placeholder for the particular control you can edit that control settings. Then save everything so that when the real page is loaded all the docks, with controls and settings are loaded.
Written that way may seem complex but is exactly what you do with wordpress widgets. You drag and drop the kind of widget that you want (news, weather, whatever) inside zones (usually center or column) and then each widget that you dragged has settings for that particular control inside it. Then when you save you have the real page configured with widgets (docks) and controls.
Slav
Telerik team
 answered on 19 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?