Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
395 views
HI,
In the grid with inline editing the template is already defined with labels and text-boxes..But when the users clicks on the edit button on command item template i want the show the template with drop-downs i.e different template from current one.How can i do this?
Attached file is the screenschot taken in inline edit mode.
 i want to have dropdowns instead of text-boxes  , labels are same .on click of command in command item template.
Shinu
Top achievements
Rank 2
 answered on 24 Mar 2012
0 answers
97 views
Hello everyone!

I am developing a software for Textile Industry. I have a scenario in which there are 3 grids i am using. 1 for Warp Count, 1 for Weft Count and 1 for Composition. Maximum counts allowed are 4 in both warp and weft counts, In composition grid i am pulling composition from a setup table. What I need is to show 4 blank rows in warp and weft count grids as default so that the user can select desired yarn from the ComboBox. Warp and Weft Counts Grids contains 4 columns YarnSupplier, YarnQuality, YarnName and Ratio%. 

My question is how to show 4 rows when the webform opens. And what if i want to add a blank row after Ratio% entered in the column.

I have searched a lot but couldn't find any solution. Please help me to save my time in searching.

Please reply

Thanks and regards,
Shah
Top achievements
Rank 1
 asked on 24 Mar 2012
7 answers
110 views
Does anyone know of a textbox that merges the functionality of combobox functionality like we see present in the Facebook wall?  More and more clients are beginning to ask for smart textboxes which no vendor provides yet (unless I am missing it) that allows for portions of the text box to be a hyperlink from a list of entries identified below that can be clicked.  Often it would be nice to have multiple different entries have links in the text box but be light enough to use as a textbox replacement.

When we access the textbox in a post back, it would be great to have a collection to retrieve the entries people located.  To see this, use the @ as you type in the facebook wall.

regards,
Dave
Iana Tsolova
Telerik team
 answered on 24 Mar 2012
2 answers
61 views

I have a simple grid bound to a List of objects.

I have a command button that calls a javascript function which executes an ajax request. In that request I add a new item to the list and rebind my grid. The new item flashes in the grid for a moment then dissappears, leaving only the original item. I am new to telerik but this seem so basic. I must be missing something or not sure how to do this. See code below.



Default.aspx

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="bug._Default" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head id="Head1" runat="server">
<title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">    
        <script type="text/javascript" id="telerikClientEvents1">
            function RadButton1_Clicked(sender, args) {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            }
  
        </script>
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grdVoucherTypes" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
        </AjaxSettings>
      
    </telerik:RadAjaxManager>
  
      
    <table width="600px" style="margin: 0px auto">
    <tr><td style="text-align: center">
        <telerik:RadButton ID="RadButton1" runat="server" onclientclicked="RadButton1_Clicked" Text="CLick me to add new item" >
        </telerik:RadButton>
        </td>
        </tr>
        <tr>
        <td>
        <telerik:RadGrid ID="grdVoucherTypes" runat="server" AutoGenerateColumns="False" CellSpacing="0" Width="59%" style="margin-top:10px; margin-left: auto; margin-right: auto; margin-bottom: 0px;" AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="20" >
                
            <MasterTableView ClientDataKeyNames="VoucherTypeID">
                <Columns>
                    <telerik:GridBoundColumn HeaderText="ID"  DataField="VoucherTypeID" UniqueName="VoucherTypeID" Visible="False" DataType="System.Int32" ReadOnly="True"/>
                    <telerik:GridBoundColumn HeaderText="Description" DataField="VoucherTypeDesc" UniqueName="VoucherTypeDesc">
                        <ItemStyle HorizontalAlign="Left"/>
                        <HeaderStyle Width="200px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                </Columns>
  
</MasterTableView>
</telerik:RadGrid>
</td>
</tr>
    </table>
    </form>
</body>
</html>

Default.aspx.vb
Public Class _Default
    Inherits System.Web.UI.Page
  
    Public Property MyList() As List(Of VoucherType)
        Get
            Return Session("MyList")
        End Get
        Set(value As List(Of VoucherType))
            Session("MyList") = value
        End Set
    End Property
  
    Sub RadAjaxManager1_AjaxRequest(sender As Object, e As Telerik.Web.UI.AjaxRequestEventArgs)
  
        Dim x As New VoucherType
        x.VoucherTypeID = 10
        MyList.Add(x)
  
        grdVoucherTypes.Rebind()
  
    End Sub
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim x As New List(Of VoucherType)
        Dim y = New VoucherType
        y.VoucherTypeID = 1
        x.Add(y)
  
        MyList = x
  
        'grdVoucherTypes.DataSource = MyList
  
    End Sub
  
    Private Sub grdVoucherTypes_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles grdVoucherTypes.NeedDataSource
        grdVoucherTypes.DataSource = MyList
    End Sub
  
End Class
  
Public Class VoucherType
    Private m_VoucherTypeID As Long
    Private m_VoucherTypeDescription As String
    Private m_Value As Long
    Public IsNew As Boolean
  
  
    Public Property Value As Long
        Get
            Return m_Value
        End Get
        Set(value As Long)
            m_Value = value
        End Set
    End Property
  
    Public Property VoucherTypeID As Long
        Get
            Return m_VoucherTypeID
        End Get
        Set(value As Long)
            m_VoucherTypeID = value
        End Set
    End Property
  
    Public ReadOnly Property Available As Long
        Get
            Return 0
        End Get
    End Property
  
    Public ReadOnly Property Active As Long
        Get
            Return 0
        End Get
    End Property
  
    Public ReadOnly Property Expired As Long
        Get
            Return Available - Active
        End Get
    End Property
  
    Public Property VoucherTypeDescription As String
        Get
            Return m_VoucherTypeDescription
        End Get
        Set(value As String)
            m_VoucherTypeDescription = value
        End Set
    End Property
  
    Public ReadOnly Property VoucherTypeDesc As String
        Get
            Dim str As String
            str = Value
  
            Return "Test voucher"
        End Get
    End Property
  
End Class




Kim
Top achievements
Rank 1
 answered on 24 Mar 2012
1 answer
128 views
I am using a single row listview as a means to navigate my file.  The list view loads properly, but when I put my cursor over the item the cursor doesn't change to a pointing finger and when I click on the item I want, none of my code is executed in my behind code.

</div>
<telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server">
</telerik:GridTextBoxColumnEditor>
<asp:SqlDataSource ID="salesreps" runat="server"
    ConnectionString="<%$ ConnectionStrings:cbfSQLConnectionString %>"
    SelectCommand="SELECT [firstname], [lastname] FROM [salesrep] ORDER BY [termdate], [salesno]">
</asp:SqlDataSource>
<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="salesreps" 
    onneeddatasource="RadListView1_NeedDataSource" AllowPaging="True">
    <LayoutTemplate>
        <div class="RadListView RadListView_Forest">
            <table cellspacing="0">
                <tr>
                    <td ID="itemPlaceholder" runat="server">
                    </td>
                </tr>
            </table>
        </div>
    </LayoutTemplate>
    <ItemTemplate>
        <td class="rlvI">
            <asp:Label ID="firstnameLabel" runat="server" Text='<%# Eval("firstname") %>' />
            <br/>
            <asp:Label ID="lastnameLabel" runat="server" Text='<%# Eval("lastname") %>' />
            <br/>
        </td>
    </ItemTemplate>
    <AlternatingItemTemplate>
        <td class="rlvA">
            <asp:Label ID="firstnameLabel" runat="server" Text='<%# Eval("firstname") %>' />
            <br/>
            <asp:Label ID="lastnameLabel" runat="server" Text='<%# Eval("lastname") %>' />
            <br/>
        </td>
    </AlternatingItemTemplate>
    <EditItemTemplate>
        <td class="rlvIEdit">
            <table cellspacing="0" class="rlvEditTable">
                <tr>
                    <td>
                        <asp:Label ID="firstnameLabel2" runat="server" 
                            AssociatedControlID="firstnameTextBox" Text="firstname">
                        </asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="firstnameTextBox" runat="server" CssClass="rlvInput"
                            Text='<%# Bind("firstname") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lastnameLabel2" runat="server"
                            AssociatedControlID="lastnameTextBox" Text="lastname">
                        </asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="lastnameTextBox" runat="server" CssClass="rlvInput"
                            Text='<%# Bind("lastname") %>' />
                    </td>
                </tr>
            </table>
        </td>
    </EditItemTemplate>
    <EmptyDataTemplate>
        <div class="RadListView RadListView_Forest">
            <div class="rlvEmpty">
                There are no items to be displayed.
            </div>
        </div>
    </EmptyDataTemplate>
    <SelectedItemTemplate>
        <td class="rlvISel">
            <asp:Label ID="firstnameLabel" runat="server" Text='<%# Eval("firstname") %>' />
            <br/>
            <asp:Label ID="lastnameLabel" runat="server" Text='<%# Eval("lastname") %>' />
            <br/>
        </td>
    </SelectedItemTemplate>
</telerik:RadListView>
<telerik:RadSlider ID="PagerSlider" runat="server"
    MaximumValue="4" CssClass="slider"
    DecreaseText="Prev" IncreaseText="Next" DragText='<%# "Page " + (RadListView1.CurrentPageIndex + 1).ToString() + " of 5" %>'
    AutoPostBack="True" OnValueChanged="PagerSlider_ValueChanged"
    DbValue="0" Height="22px" Length="200" Width="200px">
</telerik:RadSlider>
Richard
Top achievements
Rank 1
 answered on 23 Mar 2012
2 answers
143 views
I was going through the following KB article (Centering the buttons of the predefined dialogs and keeping the image aligned to the top):
http://www.telerik.com/support/kb/aspnet-ajax/window/centering-the-buttons-of-the-predefined-dialogs-and-keeping-the-image-aligned-to-the-top.aspx

The code  works fine for default RadAlert dimensions. It also works if I make the RadAlert window wider.
But it will not work anymore if I make RadAlert window 'higher', for example using the following code:

Dim scriptstring As String = "radalert('Welcome to Rad window!', 550, 250);"
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "radalert", scriptstring, True)

The 'Ok' button will be aligned to right but it will stay towards the top right of the window instead bottom-right...
Can you please help to add any additional code that will solve this issue? (and also make the KB article better)

Regards,
M.R.
M. R.
Top achievements
Rank 1
 answered on 23 Mar 2012
0 answers
99 views
i have added the unzip command to the fileexplorer but it will not extract the files .. here is the code i am using.
function OnGridContextItemClicked(oGridMenu, args) {
           var menuItemText = args.get_item().get_text();
           if (menuItemText == "UnZip") {// 'UnZip' command
               var oExplorer = $find("<%= rfeStorage.ClientID %>");
               var oAjaxPanel = $find("<%= RadAjaxPanel1.ClientID %>");
 
               var selectedItem = oExplorer.get_selectedItem();
               if (selectedItem.get_extension() == "zip") {
                   //var itemExt = ; // get the extension of the current item 
 
                   var itemPath = selectedItem.get_path(); // get the path of the current item 
                   oAjaxPanel.ajaxRequest(itemPath); // Call the RadAjaxPanel1_AjaxRequest function on the server ; 
                    
                   
               }
               else {
                   alert("Please, select a ZIP file");
               
           }
       }
       //]]>
   </script>
   RadMenuItem item = new RadMenuItem("UnZip");
                item.PostBack = false;
                item.Value = "CustomValue";
 
                rfeStorage.GridContextMenu.Items.Add(item);
                rfeStorage.GridContextMenu.OnClientItemClicked = "OnGridContextItemClicked";
}
 
   protected void RadAjaxPanel1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            string path = e.Argument;
            LblAjaxPanel.Text = path;
        }
Please write me back asap. Thanks in advance
*revision*
I realized i dont have the function for the unzipping process can someone help me with that! please!
Corey
Top achievements
Rank 1
 asked on 23 Mar 2012
2 answers
73 views
Hello 

As i can know if the GridClientSelectColumn  is checked in the radgridview?.


thank you very much beforehand 





mauricio
Top achievements
Rank 1
 answered on 23 Mar 2012
7 answers
253 views
im using radgrid q3 2009.
im loading images via code behind

using the following code

If

 

TypeOf e.Item Is GridDataItem Then

 

 

Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)

 

 

 

If item("mattach").Text = MailHasAttach Then

 

 

Dim img As New System.Web.UI.WebControls.Image

 

 

img.ID =

"attachpic"

 

img.ImageUrl = Session(

"virtualdir") & Session("imagepath") & "attach.gif"

 

item(

"mattach").Controls.Add(img)

 

 

 

'End If

 

 

Else

 

 

Dim img As New System.Web.UI.WebControls.Image

 

 

img.ID =

"attachpic"

 

img.ImageUrl = Session(

"virtualdir") & Session("imagepath") & "blank.gif"

 

item(

"mattach").Controls.Add(img)

 

 

 

End If

 



when binding to datasource the images loaded in grid but when the page is refreshed without rebind it looses the images

could you please help?
Pavlina
Telerik team
 answered on 23 Mar 2012
2 answers
128 views
Hi I have a radtooltip with an image inside declared as follows in .aspx file
<telerik:RadToolTip ID="RadToolTip1" runat="server"
                                                   TargetControlID="help" IsClientID="true" Animation="Slide">
                                                           <asp:Image ID="Image2" runat="server"  />
                                                      
                                                       </telerik:RadToolTip>
what I want to do is change the image based on the index of a radcombobox.
I've try something like this

protected void RadComboBox6_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
       {
          
               case 1:
             Image2.ImageUrl = "/App_Themes/img/Mexico-Credencial-del-elector-reverso.jpg";
                   break;

                   
                   break;
               case 2:
                   Image2.ImageUrl = "/App_Themes/img/AGUILA-PJF.JPG";
                   break;
           }
       }

But no success. is this the correct way to show an image in a tooltip?
If yes, how can I change the image on rancombobox.selectedindexchange?
Cristian
Top achievements
Rank 1
 answered on 23 Mar 2012
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?