Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
172 views
I'm creating some dynamic docks using server-side code, and I'm having an issue trying to set the behavior property.

If I want a dock to have pin, close, collapse, but also be resizable then I set the behavior like this:

<rad:RadDockableObject id="myObject" runat="server" text="The title" behavior="Close, Collapse, Pin, Resize" />

If I do it in server code, I am not given a collection to modify.  I can only set one of those properties using the RadDockableObjectBehaviorFlags.

How do I set all of these properties?

The closest I can get is using commands:
SomeDock.Commands.Add(new RadDockableObjectCommand("Close"))
SomeDock.Commands.Add(new RadDockableObjectCommand("Collapse"))
SomeDock.Commands.Add(new RadDockableObjectCommand("Pin"))

But if I do this, whenever I pin an object the pin command dissapears and I cannot unpin it!

Seems like a bug perhaps or perhaps programmer error on my part?

Does anyone have a working example for me?

joe
Joseph
Top achievements
Rank 1
 answered on 24 Oct 2008
2 answers
120 views
can you use stored procedure with grid instead of select statment?
appdev
Top achievements
Rank 1
 answered on 24 Oct 2008
2 answers
148 views
sorry for doubleposting here. but i posted it to the wrong forum. so please
delete the posting in the menu forum if possible.

is it possible to define global keyboard shortcuts for telerik controls?

e.g. i'd like to display a context menu centered on my site if the user pressed str + [someKey]. is there a telerik way for registering global shortcuts or do i have do use some other lib?

pantarhei
Top achievements
Rank 1
 answered on 24 Oct 2008
14 answers
306 views
I have a simple page that has a TextBox control and the RADEditor control. In Page_Load I'm giving the text box focus. In IE, the focus appears to be "taken" by the editor after the page has loaded. I can work around this so far only by forcing focus to the text box in client script with a setTimeout call using a high timeout value (at least 5000). I tried forcing focus to the text box in the OnClientLoad handler, but that didn't work. Please advise.
Rumen
Telerik team
 answered on 24 Oct 2008
6 answers
426 views
We have a RadGrid linked up to a ContextMenu to give the user options when a row on the RadGrid is clicked.

The code is as follows:

<ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            <ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>
            <Resizing EnableRealTimeResize="True" />
</ClientSettings>   

And our on page JavaScript is:

function RowContextMenu(sender, eventArgs)
    {
        var menu = $find("<%= RadMenu1.ClientID %>");
        var evt = eventArgs.get_domEvent();                  
        
        var index = eventArgs.get_itemIndexHierarchical();
        document.getElementById("radGridClickedRowIndex").value = index;
        
        sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);
        
        menu.show(evt);
        
        evt.cancelBubble = true;
        evt.returnValue = false;

        if (evt.stopPropagation)
        {
           evt.stopPropagation();
           evt.preventDefault();
        }
    }

I'm trying to move this javascript to an external function, but to do that I need to either pass in the RadGrid ID or I need to retrieve it from the Sender object to replace the first line.

Any ideas?



Rick
Top achievements
Rank 1
 answered on 24 Oct 2008
8 answers
450 views
I have a color coded bar graph.  I want to use the x axis labels in the legend.  In other words I want each bar graph color to be labeled in the legend instead of using the x axis label.  Any code help would be appreciated.

I have the following code  which shows item 1, item 2, etc.  appear in the legend.

LBGChart.Series[0].Appearance.LegendDisplayMode = Telerik.Charting.

ChartSeriesLegendDisplayMode.ItemLabels;

I want the legend to coorespond or be the same as  the x axis labels.  So basically I'm asking how to customize the text.

 

Ves
Telerik team
 answered on 24 Oct 2008
1 answer
134 views

I have a scheduler to which i have tried to put a ContextMenu if the page is out of a MasterPage works well, but if the page work with masterPage the context menu does not open, open the popup normal when right-click is clicked

I acknowledge that it is not always fails, it fail when there is some data loaded in the scheduler if there is no data works perfect of the two forms.

Any idea or suggestion that could be affecting the behavior.????


   <telerik:RadContextMenu ID="rdm_popup" Runat="server" ClickToOpen="True"
              Skin="Office2007">
              <Targets>
                  <telerik:ContextMenuControlTarget ControlID="chkl_sala" />
                  <telerik:ContextMenuControlTarget ControlID="rds_cirugias" />
              </Targets>
<CollapseAnimation Type="InQuad" Duration="200"></CollapseAnimation>
              <ExpandAnimation Type="InQuad" />
              <Items>
                  <telerik:RadMenuItem runat="server" Text="Data1">
                  </telerik:RadMenuItem>
                  <telerik:RadMenuItem runat="server" Text="Data2">
                  </telerik:RadMenuItem>
              </Items>
          </telerik:RadContextMenu>

 

Yana
Telerik team
 answered on 24 Oct 2008
2 answers
284 views
I have a radgrid, and 3 of my fields have validators on them. The login_name, password and email have requiredfieldvalidator and the email also has a regularexpression validator. I do not want the fields to be validated while entering data, only when the user clicks the update or insert button. This is becasue I also have a dropdown combo box in the form and when this dropdown combo changes, I have 2 embedded grids that change based on the choice in the combo box. But if one of the 3 fields fails validation, and the user changes the combobox, the 2 embedded grids do not reload. My fix to this would be the validation not occur until update or insert is clicked, but I cant get this work work.

Here are the 3 columns with the validation and then the combobox and one of the embedded grids:



<Columns>
        <telerik:GridEditCommandColumn ButtonType="ImageButton"  UniqueName="EditCommandColumn1">
                    <HeaderStyle Width="20px" />
        </telerik:GridEditCommandColumn>
        <telerik:GridBoundColumn DataField="user_id" UniqueName="user_id" Visible="false" ReadOnly="true" ></telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="package_cd" UniqueName="package_cd" Visible="false" ReadOnly="true" ></telerik:GridBoundColumn>

        <telerik:GridTemplateColumn HeaderText="Seat(User)" SortExpression="login_name" UniqueName="login_name" >
          <ItemTemplate>
             <asp:Label ID="login_name"   runat="server"  Text='<%#Eval("login_name") %>'></asp:Label>
          </ItemTemplate>
          <EditItemTemplate>
             <asp:TextBox ID="loginname" Text='<%#Eval("login_name") %>'  runat="server"  OnTextChanged="change_loginName"></asp:TextBox>
             <asp:RequiredFieldValidator id="loginnameRequiredFieldValidator" runat="server" ErrorMessage="* User name required" Display="Dynamic"
        ControlToValidate= "loginname"></asp:RequiredFieldValidator>
          </EditItemTemplate>
        </telerik:GridTemplateColumn>
        
        <telerik:GridTemplateColumn HeaderText="Password" SortExpression="password" UniqueName="password"  EditFormColumnIndex="1" AllowFiltering="false">
          <ItemTemplate>
             <asp:Label ID="password"   runat="server"  Text='<%#Eval("password") %>'></asp:Label>
          </ItemTemplate>
          <EditItemTemplate>
             <asp:TextBox ID="editPassword" Text='<%#Eval("password") %>'  runat="server"  OnTextChanged="change_Password" ></asp:TextBox>
             <asp:RequiredFieldValidator id="passwordRequiredFieldValidator" runat="server" ErrorMessage="* Password required" Display="Dynamic"
        ControlToValidate= "editPassword"></asp:RequiredFieldValidator>
          </EditItemTemplate>
        </telerik:GridTemplateColumn>
        
        <telerik:GridTemplateColumn HeaderText="Email" SortExpression="email" UniqueName="email" >
          <ItemTemplate>
             <asp:Label ID="email"   runat="server"  Text='<%#Eval("email") %>'></asp:Label>
          </ItemTemplate>
          <EditItemTemplate>
             <asp:TextBox ID="editEmail" Text='<%#Eval("email") %>'  runat="server"  OnTextChanged="change_email"></asp:TextBox>
             <asp:RequiredFieldValidator id="emailValidator1" runat="server" ErrorMessage="* Email required"    Display="Dynamic"
                 ControlToValidate= "editEmail"></asp:RequiredFieldValidator>        
             <asp:RegularExpressionValidator Runat="server" ErrorMessage="* Invalid E-mail Address" ID="emailValidator2"  Display="Dynamic"
                 ControlToValidate="editEmail" ValidationExpression=".+@.+\.[a-z]+"></asp:RegularExpressionValidator>
          </EditItemTemplate>
          
        </telerik:GridTemplateColumn>

<telerik:GridTemplateColumn HeaderText="Package"  UniqueName="DefaultPackage" EditFormColumnIndex="1" >
                       <HeaderStyle Width="100%" />
                        <ItemTemplate>
                            <asp:Label runat="server" ID="Label1" Text='<%#Eval("package_name") %>'></asp:Label>
                            <telerik:RadToolTip runat="server" ID="RadToolTip1" TargetControlID="Label1"
                                Skin="Web20" ShowDelay="1000" AutoCloseDelay="200000" Font-Names="arial"
                                Font-Size="XX-Large" BorderStyle="Inset" HideDelay="100000" ManualClose="False"
                                Position="BottomRight" Sticky="True" Width="300">   
                                    <asp:Label runat="server" ID="Label3" Text='<%#Eval("descriptions") %>'></asp:Label><br/>                                                  
                             </telerik:RadToolTip>
                        </ItemTemplate>
                        <EditItemTemplate>
                        <telerik:RadComboBox  ID="package"  Width="220px"  runat="server"  OnSelectedIndexChanged="RadComboBoxSelectedIndexChanged"
                                MarkFirstMatch="True"  AllowCustomText="True" DataSourceID="ContentCentralPackages"   EmptyMessage="Select a package"
                              ExpandAnimation-Type="None"  CollapseAnimation-Type="None" AutoPostBack="true" AppendDataBoundItems="false"  OnClientSelectedIndexChanging="setnewprice"
                                DataTextField="package_name" DataValueField="package_cd" DropDownWidth="650px"  OnClientKeyPressing="setnewprice"
                               Skin="WebBlue"  SelectedValue='<%# Bind("package_cd") %>'
                                EnableVirtualScrolling="True" HighlightTemplatedItems="True">
                             <ExpandAnimation Type="None" />
                             <CollapseAnimation Duration="200" Type="None" />
                             
                             
                          <HeaderTemplate>
                           <table style="width: 620px; text-align: left">
                            <tr>
                                <td style="width: 170px;">
                                    Package Name
                                </td>
                                <td style="width: 450px;" >
                                    Description
                                </td>
                                <td style="width: 0px;" >
                                    
                                </td>
                               
                            </tr>
                          </table>
                        </HeaderTemplate>
                    <ItemTemplate>
                        <table style="width: 620px; text-align: left">
                            <tr>
                                <td style="width: 170px;" valign="top">
                                    <%# DataBinder.Eval(Container.DataItem, "package_name") %>
                                </td>
                                <td style="width: 450px;">
                                    <%# DataBinder.Eval(Container.DataItem, "descriptions") %>
                                </td>
                               
                                
                            </tr>
                        </table>
                    </ItemTemplate>
            
                          </telerik:RadComboBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                   <telerik:GridTemplateColumn HeaderText="Package Price" UniqueName="NumericPrice" AllowFiltering="false" >
                      <ItemTemplate>
                        <telerik:RadNumericTextBox ID="inGridPkgPrice" runat="server"  Price='<%# Eval("packageprice") %>'  
                                    Culture="English (United States)" Type="Currency"   DbValue='<%# DataBinder.Eval(Container.DataItem, "packageprice") %>'  
                                      Width="125px"  OnTextChanged="RadNumericInlineGridTextChanged" AutoPostBack= "true">  
                                     
                         </telerik:RadNumericTextBox>
                      </ItemTemplate>
                      <EditItemTemplate>
                        <telerik:RadNumericTextBox ID="inFormPkgPrice" runat="server"  Price='<%# Eval("packageprice") %>'  
                                    Culture="English (United States)" Type="Currency"   DbValue='<%# DataBinder.Eval(Container.DataItem, "packageprice") %>'  
                                      Width="125px"   OnTextChanged="RadNumericDefaultPackageTextChanged">  
                                      <ClientEvents OnLoad="PriceBoxLoad"  />
                                  </telerik:RadNumericTextBox>
                      </EditItemTemplate>
                    
                    </telerik:GridTemplateColumn>
                      <telerik:GridMaskedColumn  DataField="packageprice"  Mask="$ #####.##" DataFormatString="{0:C2}" HeaderText="Package Price" Display="true" UniqueName="readonlyPackagePrice"
                                  readonly="true"  AllowFiltering="false">
                         <ItemStyle HorizontalAlign="Right" />
                      </telerik:GridMaskedColumn>
                   
                        <telerik:GridMaskedColumn  DataField="packagealaprice"  Mask="$ #####.##" DataFormatString="{0:C2}" HeaderText="Ala Carte Price" Display="true" UniqueName="packagepriceala"
                                  readonly="true"  AllowFiltering="false">
                         <ItemStyle HorizontalAlign="Right" />
                      </telerik:GridMaskedColumn>
       
            <telerik:GridTemplateColumn EditFormHeaderTextFormat=""  HeaderStyle-VerticalAlign="Top" Visible="false" UniqueName="PackagePriceGrid">
             <EditItemTemplate>
               <telerik:RadGrid ID="PackagePriceGrid" runat="server" AutoGenerateColumns="False" DataSourceID="spAddNewsTradeProduct"  
                                GridLines="None" Skin="Office2007" onitemdatabound="PackagePriceGrid_ItemDataBound" OnItemCommand="PackageGrid_ItemCommand"
                              ShowStatusBar="True" OnPreRender="PackagePriceGrid_PreRender" >
                  <MasterTableView CommandItemDisplay="None" EditMode="InPlace" DataKeyNames="service_id,Checked" >   
                    <Columns>
                       <telerik:GridBoundColumn  UniqueName="service_id" DataField="service_id" Visible="false" Display="false">
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="service_name" HeaderText="Default Package"  Display="true" UniqueName="service_name" >
                       </telerik:GridBoundColumn>
                       <telerik:GridTemplateColumn HeaderText="Purchased" UniqueName="CHECKED">
                        <ItemTemplate>
                          <asp:CheckBox ID="Entitled"  Checked='<%# Eval("Checked") %>' runat="server" />
                                 </ItemTemplate>
                          </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn  UniqueName="PKGPRICE" HeaderText=""  Display="false" >
                        <ItemTemplate>
                                  
                                  <telerik:RadNumericTextBox ID="PKGPRICE" runat="server"  Price='<%# Eval("Price") %>'
                                    Culture="English (United States)" Type="Currency"   DbValue='<%# DataBinder.Eval(Container.DataItem, "Price") %>'  
                                      Width="125px" >  
                                      <ClientEvents    OnLoad="priceLoaded"  OnValueChanged="priceLoaded" />
                                  </telerik:RadNumericTextBox>
                               </ItemTemplate>
                           <EditItemTemplate>
                                  
                                  <telerik:RadNumericTextBox ID="PKGPRICE" runat="server"  Price='<%# Eval("Price") %>'
                                    Culture="English (United States)" Type="Currency"   DbValue='<%# DataBinder.Eval(Container.DataItem, "Price") %>'  
                                      Width="125px" >  
                                      <ClientEvents    OnLoad="priceLoaded"  OnValueChanged="priceLoaded" />
                                  </telerik:RadNumericTextBox>
                               </EditItemTemplate>
                         </telerik:GridTemplateColumn>
                     </Columns>
                    
                  </MasterTableView>
                </telerik:RadGrid>                    
              </EditItemTemplate>
             <HeaderStyle VerticalAlign="Top"></HeaderStyle>
          </telerik:GridTemplateColumn>   
         

Laura
Top achievements
Rank 1
 answered on 24 Oct 2008
5 answers
177 views
I used a code like this to load my data:


 Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not Page.IsPostBack Then
                LoadRootNodes()
            End If
        End Sub

 Private Sub LoadRootNodes()
   Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("TelerikConnectionString").ConnectionString)
Dim selectCommand As New SqlCommand("SELECT * FROM Nodes WHERE ParentId IS NULL", connection)
            Dim adapter As New SqlDataAdapter(selectCommand)
            Dim data As New DataTable()
            adapter.Fill(data)

            For Each row As DataRow In data.Rows
                Dim node As New RadTreeNode()
                node.Text = row("Text")
                node.Value = row("Id")
                node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack
                RadTreeView1.Nodes.Add(node)
            Next
        End Sub


        Protected Sub RadTreeView1_NodeExpand(ByVal sender As Object, ByVal e As RadTreeNodeEventArgs) Handles RadTreeView1.NodeExpand

            Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("TelerikConnectionString").ConnectionString)

            Dim selectCommand As New SqlCommand("SELECT Nodes.Id AS NodeId, Nodes.Text AS NodeText, COUNT(Children.Id) AS ChildCount FROM Nodes LEFT JOIN Nodes As Children ON Nodes.Id = Children.ParentId WHERE Nodes.ParentId = @parentId GROUP BY Nodes.Id, Nodes.Text", connection)

            selectCommand.Parameters.AddWithValue("parentId", e.Node.Value)
            Dim adapter As New SqlDataAdapter(selectCommand)
            Dim data As New DataTable()
            adapter.Fill(data)

            For Each row As DataRow In data.Rows
                Dim node As New RadTreeNode()
                node.Text = row("NodeText")
                node.Value = row("NodeId")
                If CInt(row("ChildCount")) > 0 Then
                    node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack
                End If
                e.Node.Nodes.Add(node)
            Next
            e.Node.Expanded = True
        End Sub





But I need expland all my nodes when I load the page. How can I expland all nodes without use the event RadTreeView1_NodeExpand.


Thanks.
Veselin Vasilev
Telerik team
 answered on 24 Oct 2008
3 answers
134 views
Hi, I develop WebPart included RadGrid 2008 Q2. I want to use Drag&Drop in this grid and set next options:

grid.ShowGroupPanel =

true;

 

grid.ClientSettings.AllowDragToGroup =

true;

 

I build and deploy WebPart  on test machine (VPC for SharePoint developer from Microsoft). It works fine. After I deploy WebPart on my work server (2003 Server SP2 + IE7). Add this WebPart on page. I see that Drag&Drop doesn't work. Mouse cursor doesn't look like as cross and I can't move a column header to group panel. What's a problem in? Thank you.
Rosen
Telerik team
 answered on 24 Oct 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?