Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
121 views
can you use stored procedure with grid instead of select statment?
appdev
Top achievements
Rank 1
 answered on 24 Oct 2008
2 answers
152 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
317 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
441 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
459 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
135 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
288 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
186 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
137 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
3 answers
222 views
Hi.

I'm looking to use the scheduler to check the availability of recources over multiple days. There can only be one 24 hour appointment for each resource between a set date span. Currently, the grid can group by resource in timelime view - which is great - but I would like to make sure each resource can only have one entry.

I will explain my situation to try and make myself a bit clearer. We have 20 rooms which can be hired out in 24 hour periods, and there can only be one occupant listed for that room. You can view a picture of what I'm trying to achieve here.

Can you please advise the best way to restrict the row to a single line height (so bookings cannot overlap for that resource) whilst still enabling insert into available slots?

Many thanks.
Peter
Telerik team
 answered on 24 Oct 2008
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?