Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
297 views
I took your sample ListBoxInItemComboTemplate and modified to have the listbox populated with data from a datasource.  That works fine.  I need to add an item "ALL" and what I'm hoping to do is to check if the user selected "ALL" then turn off the other items in the listbox.  Would that be done on the client side? 
<td><telerik:RadComboBox ID="ObjectiveCombo" Runat="server" 
    DataTextField="ObjectiveName"
    DataValueField="ObjectiveID" Skin="Office2007" Width="487px" 
    OnClientDropDownClosed = "onObjectiveDDClosed" 
        >
         
        <Items><telerik:RadComboBoxItem Text="" />
         </Items>
        <ItemTemplate>
                <div id="div1">
                    <telerik:RadListBox ID="RadListBox1" runat="server" Width="100%" SelectionMode="Multiple"
                        OnClientSelectedIndexChanged="onSelectedIndexChangedObjective" 
                        DataSourceID="ObjectiveDS" DataTextField="ObjectiveName" 
                        DataValueField="ObjectiveID">
                    </telerik:RadListBox>
                </div>
                <script type="text/javascript">
                    var div1 = document.getElementById("div1");
                    div1.onclick = stopPropagation;
                </script>
            </ItemTemplate>
  
</telerik:RadComboBox>
This is what I have.  The listbox is inside an item template.

Also, I was trying to find out how many items I have selected in my listbox when the dropdown closes.  The get_value() call works but the get_count() gives an error. 
function onObjectiveDDClosed(sender, eventArgs) {
        var text = "";
        var value = "";
  
        var comboBox = $find("<%= ObjectiveCombo.ClientID %>");
        var items = comboBox.get_items().getItem(0).get_value();
        var num = comboBox.get_items().getItem(0).get_count(); 
        alert(num);
        var total = items.split(",");
        alert(total.length);
          
         
         
    }
This client-side stuff is a little new for me.  It's frustrating when you know what you want, but you struggle with a new language.
Dimitar Terziev
Telerik team
 answered on 24 Nov 2010
1 answer
129 views
I would like to know how to create google like radcombobox in the details table for insert and edit mode in the hierarchical grid.
Please help.
    <telerik:RadGrid ID="RadGridFunding" runat="server" AllowPaging="True" AllowSorting="True" GridLines="None"  
        PageSize="10" AutoGenerateColumns="False" AllowMultiRowSelection="False" DataSourceID="SqlDsLineItem" ShowFooter="true">
        <MasterTableView HierarchyDefaultExpanded="false" InsertItemPageIndexAction="ShowItemOnFirstPage" 
            HierarchyLoadMode="Client" DataKeyNames="LineItemNumber" Name="Main" Width="100%" 
            DataSourceID="SqlDsLineItem" ShowGroupFooter="true">
            <DetailTables>
                <telerik:GridTableView runat="server" DataKeyNames="FundingID, LineItemNumber" CommandItemDisplay="Top" 
                    Name="Detail" DataSourceID="SqlDsFunding" AllowAutomaticUpdates="true" AllowAutomaticInserts="true" ShowFooter="true" >
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="LineItemNumber" MasterKeyField="LineItemNumber" />
                    </ParentTableRelation>
                    <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True">
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <CommandItemSettings ExportToPdfText="Export to Pdf" />
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                            <HeaderStyle Width="20px" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn HeaderText="Line Item Number" SortExpression="LineItemNumber" UniqueName="LineItemNumber" Aggregate="Count" FooterText="Total Line Items: " FooterStyle-Font-Bold="true">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblLineItemNumber" Text='<%# Eval("LineItemNumber") %>' ></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <span><telerik:RadTextBox runat="server" ID="txtRadLineItemNumber" Text='<%# Bind("LineItemNumber") %>' Skin="Default" ReadOnly="true" ></telerik:RadTextBox></span>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Operating Unit" SortExpression="OperatingUnit" UniqueName="OperatingUnit" >
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblOperatingUnit" Text='<%# Eval("OperatingUnit") %>' ></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <span>
                                            <telerik:RadComboBox ID="cboRadOpUnit" runat="server" Height="200px" DropDownWidth="400px" 
                                                MarkFirstMatch="true" DataSourceID="SqlDsOpUnit" EnableLoadOnDemand="true" SelectedValue='<%# Bind("OperatingUnit") %>'
                                                HighlightTemplatedItems="true" DataTextField="OperatingUnitID" DataValueField="OperatingUnitID"
                                                OnItemsRequested="cboRadOpUnit_ItemsRequested" ToolTip="Select Operating Unit" EmptyMessage="Select..."
                                                OnSelectedIndexChanged="cboRadOpUnit_OnSelectedIndexChangedHandler" AppendDataBoundItems="true">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" Selected="True" Text="Select..." Value="0" />
                                                </Items>
                                                <HeaderTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 50px;">ID</td>
                                                            <td style="width: 300px;">OPERATING UNIT</td>
                                                        </tr>
                                                    </table>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 50px;"><%#DataBinder.Eval(Container.DataItem, "OperatingUnitID")%></td>
                                                            <td style="width: 300px;"><%#DataBinder.Eval(Container.DataItem, "OperatingUnit")%></td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </telerik:RadComboBox></span>                                        
                                <span style="color: Red; font-size: x-small">
                                            <asp:RequiredFieldValidator runat="server" ID="rfvOpUnit" ControlToValidate="cboRadOpUnit"
                                            InitialValue="Select..." ErrorMessage="Required" Display="Dynamic" /></span>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Account#" SortExpression="AccountNumber" UniqueName="AccountNumber" >
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblAccountNumber" Text='<%# Eval("AccountNumber") %>' ></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <span>
                                            <telerik:RadComboBox ID="cboRadAcctNum" runat="server" Height="200px" DropDownWidth="400px" 
                                                MarkFirstMatch="true" DataSourceID="SqlDsAcctNum" EnableLoadOnDemand="true" SelectedValue='<%# Bind("AccountNumber") %>'
                                                HighlightTemplatedItems="true" DataTextField="AccountNum" DataValueField="AccountNum"
                                                OnItemsRequested="cboRadAcctNum_ItemsRequested" ToolTip="Select Account Number" 
                                                OnSelectedIndexChanged="cboRadAcctNum_OnSelectedIndexChangedHandler" AppendDataBoundItems="true">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" Selected="True" Text="Select..." Value="0" />
                                                </Items>
                                                <HeaderTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 70px;">ACCT NUM</td>
                                                            <td style="width: 300px;">DESCRIPTION</td>
                                                        </tr>
                                                    </table>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 70px;"><%#DataBinder.Eval(Container.DataItem, "AccountNum")%></td>
                                                            <td style="width: 300px;"><%#DataBinder.Eval(Container.DataItem, "AccountDesc")%></td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </telerik:RadComboBox></span>
                                <span style="color: Red; font-size: x-small">
                                            <asp:RequiredFieldValidator runat="server" ID="rfvRadAcctNum" ControlToValidate="cboRadAcctNum"
                                            InitialValue="Select..." ErrorMessage="Required" Display="Dynamic" /></span>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Department" SortExpression="Department" UniqueName="Department" >
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblDept" Text='<%# Eval("Department") %>' ></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <span>
                                            <telerik:RadComboBox ID="cboRadDept" runat="server" Height="200px" DropDownWidth="400px" 
                                                MarkFirstMatch="true" DataSourceID="SqlDsDept" EnableLoadOnDemand="true" SelectedValue='<%# Bind("Department") %>'
                                                HighlightTemplatedItems="true" DataTextField="DepartmentID" DataValueField="DepartmentID"
                                                OnItemsRequested="cboRadDept_ItemsRequested" ToolTip="Select Department" 
                                                OnSelectedIndexChanged="cboRadDept_OnSelectedIndexChangedHandler" AppendDataBoundItems="true">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" Selected="True" Text="Select..." Value="0" />
                                                </Items>
                                                <HeaderTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 70px;">ID</td>
                                                            <td style="width: 300px;">DEPT</td>
                                                        </tr>
                                                    </table>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <table style="width: 400px" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td style="width: 70px;"><%#DataBinder.Eval(Container.DataItem, "DepartmentID")%></td>
                                                            <td style="width: 300px;"><%#DataBinder.Eval(Container.DataItem, "DepartmentName")%></td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </telerik:RadComboBox></span>
                                <span style="color: Red; font-size: x-small">
                                            <asp:RequiredFieldValidator runat="server" ID="rfvRadDept" ControlToValidate="cboRadDept"
                                            InitialValue="Select..." ErrorMessage="Required" Display="Dynamic" /></span>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                   </Columns>
                <EditFormSettings>
                    <EditColumn ButtonType="ImageButton"/>
                </EditFormSettings>
                </telerik:GridTableView>
            </DetailTables>
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <CommandItemSettings ExportToPdfText="Export to Pdf" />
            <ExpandCollapseColumn Visible="True">
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="LineItemNumber" DataType="System.Int64" 
                    HeaderText="Line Item Number" SortExpression="LineItemNumber" 
                    UniqueName="LineItemNumber" Aggregate="Count" FooterText="Total Item: " FooterStyle-Font-Bold="true">
                </telerik:GridBoundColumn>
           </Columns>
        </MasterTableView>
        <ClientSettings AllowExpandCollapse="true" EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
    </telerik:RadGrid>
</td>
Thank you.
illumination
Top achievements
Rank 2
 answered on 24 Nov 2010
4 answers
205 views
Hey,

I'm using the RadComboBox, if I select an user out of the list it works all fine, but if this user contains é and I wanna change to any other user and click therefor again on the combo box an alert appears. (See attached pic)
Do you know how to avoid this?

Greetings
Thomas Luck
Top achievements
Rank 1
 answered on 24 Nov 2010
3 answers
224 views
Hello all,

   How do I bind the RadEditors content to a formview "field" value. e.g. the FCKEditor equivalent is

<

 

FCKeditorV2:FCKeditor ID="CallDescriptionTextBox" runat="server" Value='<%# Bind("CallDescription") %>' Width="100%" />

 


Thank you in advance
Rumen
Telerik team
 answered on 24 Nov 2010
10 answers
246 views
See the grid ...
<telerik:RadGrid ID="RadGrid1" runat="server"
    AutoGenerateColumns="false"
    OnNeedDataSource="RadGrid1_NeedDataSource">
    <MasterTableView HierarchyLoadMode="Client" ClientDataKeyNames="LastName, FirstName, Age">
        <Columns>
            <telerik:GridBoundColumn UniqueName="Col1" DataField="LastName" />
            <telerik:GridBoundColumn UniqueName="Col2" DataField="FirstName" />
        </Columns>
        <NestedViewTemplate>
            <telerik:RadTextBox ID="txtAge" runat="server" Label="Age:" Text='<%# Bind("Age") %>' />
            <telerik:RadTextBox ID="txtSex" runat="server" Label="Age:" Text='<%# Bind("Sex") %>' />
        </NestedViewTemplate>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true" />
        <ClientEvents OnRowSelected="GridRowSelected" OnRowCreated="GridRowCreated" />
    </ClientSettings>
</telerik:RadGrid>

See the JavaScript ...

function GridRowCreated(sender, e) {
    var x = e.get_gridDataItem();
    alert(x.get_nestedViews().length);
}

See my confused face when running the page and getting a zero back as result of nestedViews().length for each row.

What I actually want to be able to do is get at the controls inside the nestedView for a given row on RowClick. But I've rather fallen at the first fence.

-- 
Stuart
Tsvetina
Telerik team
 answered on 24 Nov 2010
2 answers
160 views
I am working my way through the modification of the "black" menu skin for a custom look in my application.  My first set of changes is for only changing the color of text on the items (from green to a gold color).

I have successfully changed the color of the text (and also changed the alignment of the text to 'left').  Now I need to change the color of the arrow ">" that is used when a menu item contains its own items.  As with the original "black" skin text, this arrow also shows in green.  The only place I can find where this might be possible is in the actual graphic file rmSprite.png.  I cannot find anyplace in the Menu.name.css style sheet file that might be applicable.

Is this the correct place to modify the color of the ">" or am I missing something else that should be changed?

Thanks in advance!

Lynn
Lynn
Top achievements
Rank 2
 answered on 24 Nov 2010
21 answers
258 views
I'm not sure if I am just doing something wrong but thought maybe someone could help me. I am using visual style builder to help tweak the colors for the simple skin (Menu Control) . I change the colors I want, I see them reflected on the screen. I click the save button and then when I download the file, the css values are from the original colors in the simple skin. Am I missing a step?
Vasil Yordanov
Telerik team
 answered on 24 Nov 2010
1 answer
94 views
Hi,

I am dyanamically adding the entire table to the RadEditor1.content
i.e.
<table width=100%"><colgroup><col /></colgroup>
  <tbody>
    <tr>
      <td>Name</td>
    </tr>
  </tbody>
</table>

It is giving error in PDF.

If I directly add this to content and then export it, it works.
But when I add it code-behind, it is giving error.

Thanks
Piyushkumar
Rumen
Telerik team
 answered on 24 Nov 2010
4 answers
306 views
I have a RadCalendar in MultiView mode, with AutoPostback set to true.  Multiple selections are enabled.

I want to cancel postback in response to a date click and change the
CSS class of the DOM Element (the td cell).  I'm using the client
side code shown below.  It's hooked to the OnDateClick event.

The event handler cancels postback as expected.  The first alert displays
class=radCalDefault_Default.  The second alerts class=Red.  When the event handler
completes however, the IE Developer Toolbar shows that the cells CSS class
has returned to radCalDefault_Default.

Can you advise as to how to change CSS classes on the client so that they persist?

function OvernightCalendar_OnDateClick(calendarInstance, args)
{
  var renderDay = args.get_renderDay();

  alert('Class Name: ' + renderDay.DomElement.className);
  renderDay.DomElement.className = 'Red';
  alert('Class Name (After): ' + renderDay.DomElement.className);
  args.set_cancel(true);
  return false;
}

Also: Is there a way to get Intellisense on the Telerik javascript objects?

Best,
Bob
Dimo
Telerik team
 answered on 24 Nov 2010
1 answer
85 views
Hi, I am using CustomFileSystemProvider to display the files from a shared drive on our intranet website. However, when I set the network paths in the mappings file, my understanding is that it uses the credentials of the logged in user (I have Windows authentication set up for this site). But we would like to take away the permissions that individual users have on the shared network drive and use the RadFileExplorer with a proxy user account. How do I set it up to use the proxy user?
Thanks,
Fiko
Telerik team
 answered on 24 Nov 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?