Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
343 views
Hello
I have radiobuttons in my webform. I also have a radgrid which is visible=false when I load the form.  When I select a choice on the radiobutton, I want my radgrid become visible. This is working fine. But I lose all rows that I have in my radgrid. I can only see a light blue horizontal line. Nothing appear in the radgrid. When I don't put the radgrid.visible=false I see my rows in my grid...
Here is my code
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="FEN_CHANGEMENT_INSTALLATION_LOGICIELLE.aspx.vb" Inherits="Interface_RT.FEN_CHANGEMENT_INSTALLATION_LOGICIELLE" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register TagPrefix="header" TagName="a" Src="Template.ascx" %>   
<%@ Register TagPrefix="header" TagName="b" Src="TemplateFin.ascx" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Assistance TI</title> 
     <link href="Style.css" type="text/css" rel="stylesheet"/>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
    <header:a id="A1" runat="server"></header:a> 
     <asp:scriptmanager ID="ScriptManager1" runat="server" ></asp:scriptmanager> 
           <br /> 
      <table width="70%" align=center>   
            <tr> 
               <td colspan=2 align=center><asp:Label runat=server ID="LbTitre" Text="Installation logiciel" CssClass="TexteBlanc16center"></asp:Label><br /><br /></td>  
            </tr> 
            <tr> 
                <td align="right" width="40%"><asp:Label runat=server ID="LbCodeUtilisateur" Text="Logiciel: " CssClass="TexteBlanc12"></asp:Label></td>  
                <td align="left" width="60%"><telerik:RadTextBox ID="TxtLogiciel" runat="server" Width="200px"></telerik:RadTextBox></td>  
            </tr> 
            <tr> 
                <td align="right"><asp:Label runat=server ID="Label1" Text="Servant Ã : " CssClass="TexteBlanc12"></asp:Label></td>  
                <td align="left">  
                    <asp:RadioButtonList runat=server ID="RbntListServant"  Width="225px"  CssClass="TexteBlanc12Left" BorderColor=White BorderWidth=1 > 
                        <asp:ListItem Text="L'administratif" Value=1 ></asp:ListItem> 
                        <asp:ListItem Text="La pédagogie" Value=2 ></asp:ListItem> 
                    </asp:RadioButtonList> 
                </td> 
            </tr> 
            <tr> 
                <td align="right"><asp:Label runat=server ID="LbLocal" Text="Local(s): " CssClass="TexteBlanc12"></asp:Label></td>  
                <td align="left"><telerik:RadTextBox ID="TxtLocal" runat="server" Width="200px"></telerik:RadTextBox></td>  
            </tr> 
            <tr> 
                <td align="right"><asp:Label runat=server ID="LbPersonneContact" Text="Nom de la personne contact: " CssClass="TexteBlanc12"></asp:Label></td>  
                <td align="left"><telerik:RadTextBox ID="TxtPersonneContact" runat="server" Width="200px"></telerik:RadTextBox></td>  
            </tr> 
             <tr> 
                <td align="right"><asp:Label runat=server ID="LbPosteTelephonique" Text="Poste téléphonique: " CssClass="TexteBlanc12"></asp:Label></td>  
                <td align="left"><telerik:RadTextBox ID="TxtPosteTelephonique" runat="server"></telerik:RadTextBox></td>  
            </tr> 
            <tr> 
                <td align="right"><asp:Label runat=server ID="LbNoCSBE" Text="No CSBE: " CssClass="TexteBlanc12"></asp:Label></td>  
                <td align="left" > 
                     <asp:RadioButtonList runat=server ID="RbntListNoCSBE" AutoPostBack=true  Width="225px" BorderColor=White BorderWidth=1  CssClass="TexteBlanc12Left">  
                        <asp:ListItem Text="Tous" Value=1 ></asp:ListItem> 
                        <asp:ListItem Text="Poste(s)" Value=2 ></asp:ListItem> 
                    </asp:RadioButtonList> 
                </td> 
            </tr> 
            <tr  id="TableRadgrid" runat=server>  
                <td valign=top align=right><asp:Label runat=server ID="Label3" Text="Postes(#CSBE): " CssClass="TexteBlanc12"></asp:Label></td>  
                <td> 
                    <telerik:RadGrid   
                        ID="RadGrid_Postes"   
                        Skin="Vista"   
                        runat="server">    
                        <MasterTableView   
                            EditMode="InPlace">    
                            <Columns>                       
                                <telerik:GridTemplateColumn UniqueName="NoCSBE" HeaderText="# CSBE">    
                                    <ItemTemplate>    
                                        <asp:TextBox ID="TxtNoCsbe" runat="server"></asp:TextBox>    
                                    </ItemTemplate>    
                                </telerik:GridTemplateColumn>    
                           </Columns>    
                       </MasterTableView>    
                    </telerik:RadGrid>   
                     <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Ajouter une ligne" /> 
                </td> 
            </tr> 
            <tr> 
                <td align="right"><asp:Label runat=server ID="LbLicence" Text="Avez vous la licence?: " CssClass="TexteBlanc12"></asp:Label></td>  
                <td align="left">  
                    <asp:RadioButtonList runat=server Width="225px" AutoPostBack=true ID="RbntListLicence" BorderColor=White BorderWidth=1   CssClass="TexteBlanc12Left">  
                        <asp:ListItem Text="Non" Value=1></asp:ListItem> 
                        <asp:ListItem Text="Oui" Value=2></asp:ListItem> 
                    </asp:RadioButtonList> 
                 </td> 
             </tr> 
             <tr visible=false id="TablePB" runat=server>  
                 <td align=right>  
                     <asp:Label runat=server ID="LbPB" Text="Poste Budgétaire: " CssClass="TexteBlanc12"></asp:Label> 
                 </td> 
                 <td align=left>  
                     <telerik:RadTextBox ID="TxtPosteBudgetaire" runat="server"></telerik:RadTextBox> 
                 </td> 
             </tr> 
             <tr visible=false id="TableNombre" runat=server>  
                 <td align=right>  
                     <asp:Label runat=server ID="Label2" Text="Quel genre de licence?: " CssClass="TexteBlanc12"></asp:Label> 
                 </td> 
                 <td  align=left>  
                     <asp:RadioButtonList  runat=server ID="RbntListEtabCommNbre" Width="225px" AutoPostBack=true  CssClass="TexteBlanc12Left" BorderColor=White BorderWidth=1>  
                         <asp:ListItem Text="Établissement/Commission" Value=1></asp:ListItem> 
                         <asp:ListItem Text="Nombre" Value=2></asp:ListItem> 
                     </asp:RadioButtonList> 
                      
                 </td> 
            </tr> 
            <tr visible=false id="TableNombre2" runat=server>  
                <td align=right>  
                    <asp:Label runat=server ID="LbNombre" Text="Nombre de licences: " CssClass="TexteBlanc12"></asp:Label> 
                </td> 
                <td align=left>  
                    <telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox> 
                </td> 
            </tr> 
                      
            <tr> 
                <td align="right" valign="top"><asp:Label runat=server ID="LbDescriptionProbleme" Text="Description du problème: " CssClass="TexteBlanc12"></asp:Label></td>  
                <td align="left"><telerik:RadTextBox ID="TxtDescriptionProbleme" TextMode="MultiLine" Height="150px" Width="450px" runat="server"></telerik:RadTextBox></td>  
            </tr> 
            <tr> 
                <td>&nbsp;<br /></td>  
                <td align=left ><br /><asp:Button runat=server ID="BtnSauvegarder" Text="Sauvegarder" /></td>  
            </tr> 
        </table> 
     <header:b id="A2" runat="server"></header:b> 
    </div> 
    </form> 
</body> 
</html> 
 

Imports Telerik.Web.UI  
Partial Public Class FEN_CHANGEMENT_INSTALLATION_LOGICIELLE  
    Inherits System.Web.UI.Page  
    Public fonctionsvbs As New fonctionsvb  
    Public liste As New List(Of String)  
    Public listcount As Integer 
    Public dt As DataTable  
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
 
        If Not IsPostBack Then 
 
            dt = New DataTable()  
            dt.Columns.Add(New DataColumn("RowNumber", GetType(String)))  
 
            'Ajouter le nombre de colonne au début  
            AddRow(dt)  
            AddRow(dt)  
            AddRow(dt)  
            'Me.RadGrid_Postes.Visible = False  
            Me.RadGrid_Postes.Enabled = False 
        End If 
 
    End Sub 
 
    Private Sub BtnSauvegarder_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSauvegarder.Click  
        Dim sujet As String 
        Dim message As String 
        sujet = "Poste Ã©lève portable" 
        message = "$ rt create â€“t ticket" & _  
                "<br>Queue: " & Session("sFile") & _  
                "<br>Subject: Poste Ã©lève portable" & _  
                "<br>Status: new" & _  
                "<br>Content:Local:" & Me.TxtLocal.Text & " Problème:" & Me.TxtDescriptionProbleme.Text & _  
                "<br>ENDOFCONTENT()" & _  
                "<br>Due:" & _  
                "<br>Starts:" & _  
                "<br>Started:" & _  
                "<br>Resolved:" & _  
                "<br>Owner:  " & Session("sPropriétaire") & _  
                "<br>Requestor: " & Session("sUsager") & _  
                "<br>Cc:" & _  
                "<br>AdminCc:" & _  
                "<br>TimeWorked:" & _  
                "<br>TimeEstimated:" & _  
                "<br>TimeLeft:" & _  
                "<br>Priority: " & _  
                "<br>InitialPriority:" & _  
                "<br>FinalPriority:" & _  
                "<br>DependsOn:" & _  
                "<br>RefersTo:" & _  
                "<br>ReferredToBy:" & _  
                "<br>Children:" & _  
                "<br>DependsOnBy:" & _  
                "<br>Parents:" 
        fonctionsvbs.CreerRequis(sujet, message)  
    End Sub 
 
    Private Sub RbntListLicence_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RbntListLicence.SelectedIndexChanged  
        If RbntListLicence.SelectedValue = 1 Then 'non  
            Me.TablePB.Visible = True 
            Me.TableNombre.Visible = False 
            Me.TableNombre.Visible = False 
        ElseIf RbntListLicence.SelectedValue = 2 Then 'oui  
            Me.TablePB.Visible = False 
            Me.TableNombre.Visible = True 
        End If 
 
    End Sub 
 
    Private Sub RbntListEtabCommNbre_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RbntListEtabCommNbre.SelectedIndexChanged  
        If RbntListEtabCommNbre.SelectedValue = 1 Then 'Établissement/Commission  
            Me.TableNombre2.Visible = False 
        ElseIf RbntListEtabCommNbre.SelectedValue = 2 Then 'Nombre  
            Me.TableNombre2.Visible = True 
        End If 
    End Sub 
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)  
        Dim countitem As Integer 
        Dim dt As DataTable = DirectCast(ViewState("dt"), DataTable)  
 
        countitem = RadGrid_Postes.Items.Count  
        Dim cpt As Integer = 0  
        For Each Item As GridDataItem In RadGrid_Postes.Items  
 
            Dim txtcode As TextBox = DirectCast(Item("NoCsbe").FindControl("TxtNoCsbe"), TextBox)  
            If Not (txtcode.Text Is Nothing) And txtcode.Text <> "" Then 
                liste.Add(txtcode.Text)  
 
            End If 
 
        Next 
        ViewState("dt") = AddRow(dt)  
        listcount = liste.Count  
 
        RadGrid_Postes.Rebind()  
        While cpt < listcount  
            Dim txtcode As TextBox = DirectCast(RadGrid_Postes.Items(cpt)("NoCsbe").FindControl("TxtNoCsbe"), TextBox)  
            txtcode.Text = liste.Item(cpt)  
            cpt = cpt + 1  
        End While 
    End Sub 
 
    Private Sub RadGrid_Postes_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid_Postes.NeedDataSource  
        If Not IsPostBack Then 
            dt = AddRow(dt)  
            ' call the method to create row   
            ViewState("dt") = dt  
        End If 
        dt = DirectCast(ViewState("dt"), DataTable)  
        RadGrid_Postes.DataSource = dt  
    End Sub 
 
    Private Function AddRow(ByVal dt As DataTable) As DataTable  
        ' method to create row   
        Dim dr As DataRow = dt.NewRow()  
        dr("RowNumber") = "" 
        dt.Rows.Add(dr)  
        Return dt  
    End Function 
 
    Private Sub RadGrid_Postes_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid_Postes.PreRender  
        '  RadGrid_Postes.MasterTableView.RenderColumns(3).Display = False  
 
    End Sub 
 
    Private Sub RbntListNoCSBE_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RbntListNoCSBE.SelectedIndexChanged  
        If RbntListNoCSBE.SelectedValue = 1 Then 'Tous  
            'Me.TableRadgrid.Visible = False  
            Me.RadGrid_Postes.Enabled = False 
        ElseIf RbntListNoCSBE.SelectedValue = 2 Then 'Postes  
            'Me.TableRadgrid.Visible = True  
            Me.RadGrid_Postes.Enabled = True 
        End If 
    End Sub 
End Class 
Pavlina
Telerik team
 answered on 24 Sep 2009
7 answers
986 views
Hi,
I would like to display horizontal scroll bar only without the vertical one.
i am using paging so i need the grid to grow as the pagesize property of the grid.

how can i do that?
Thanks,
Ruth.
Sphengle
Top achievements
Rank 1
 answered on 24 Sep 2009
2 answers
125 views
Hi there
Im currently working on  grid binded against a webservice
The grid has a couple of columns GridEditCommandColumn and the second one is a GridButtonColumn.
When I press any of those commands it does not fires the postback (the on_row_command). Instead It calls the webservice again and binds the data.
I was wondering if tis possible to fire the postback in this scenario?
Cheers
Jaime Alberto Jaramillo Zapata
Top achievements
Rank 2
 answered on 24 Sep 2009
2 answers
133 views
I'm trying to change the alternate row background color for particular columns so that they are different from the applied skin that appears in the remaining columns and I'm not sure what I'm doing wrong.

Here is my CSS:
    <style type="text/css">  
         div.MfgClass tr.rgAltRow  
         {  
           background-color: red;  
         }  
    </style> 

And here is my HTML:
        <telerik:GridBoundColumn DataField="manufacturer"   
            HeaderText="Mfg" SortExpression="manufacturer"   
            UniqueName="manufacturer" ItemStyle-CssClass="MfgClass">  
            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />  
        </telerik:GridBoundColumn> 

Any help would be greatly appreciated.

Thanks,
Tim
Tim
Top achievements
Rank 1
 answered on 24 Sep 2009
1 answer
85 views
By default, the content area displays any fonts in Tahoma.  When exported to a PDF, the font is rendered as Times New Roman.  Is there a way to get both font's to match up so appearance of text is consistent?
Schlurk
Top achievements
Rank 2
 answered on 24 Sep 2009
7 answers
216 views
Hi -

 I'm doing a trial of the the Telerik grid and want to know how to do the following;

 Scenario
 1.  I databind the grid (on the server side) to a List<T> where T is a custom class.
 2.  This works fine.  The grid displays the data.

 If my grids page size is N, lets say 3 and my List<T> is > 3 items the grid does paging.  But when I try to go to the second page nothing displays.      I'm guessing the Grid is expecting a method to populate the next set of data.   

   In my instance the number of items in List<T> is so small I want ALL of the List<T> to be bound to the grid on the server side call and the grid paging to work without a server call.   Is this possible?

  I've searched the documentation and can't find anything.  

  Thanks -

  Rob

 
Nikolay Rusev
Telerik team
 answered on 24 Sep 2009
1 answer
42 views
I am using the Advanced Form and have set up 7 resources (used as dropdowns).  I'm declaratively databinding, which works fine with all of the resources.  However I need to do some other things on Insert and Update, and so I'm using the AppointmentInsert and AppointmentUpdate methods.  I'm looping through the resource collection by doing the following:

For Each res As Resource In e.Appointment.Resources  
   'Do something with res.Type, res.Key, res.Text            
Next 

This exact code works perfectly in the AppointmentUpdate method - I'm able to see all of the resources.  But for some reason, only the top 5 show in AppointmentInsert.  I have no idea what the deal is, but I need access to all of the resources.

Thanks
Shawn Tracy
Peter
Telerik team
 answered on 24 Sep 2009
1 answer
131 views
Here is my form:

            <telerik:RadGrid ID="PhoneGrid" runat="server" GridLines="None" OnUpdateCommand="PhoneGrid_OnUpdateCommand" OnDeleteCommand="PhoneGrid_OnDeleteCommand" 
                    DataSourceID="PhoneList" Skin="Office2007" Width="400">  
            <MasterTableView TableLayout="Auto" DataKeyNames="PhoneID" AutoGenerateColumns="False" DataSourceID="PhoneList" EditMode="InPlace">  
                <Columns> 
                  
                    <telerik:GridBoundColumn ColumnEditorID="PhoneNumberEditor" HeaderStyle-Width="100" ItemStyle-Width="100" DataField="PhoneNumber" HeaderText="Phone Number"  UniqueName="PhoneNumber">  
                          
                    </telerik:GridBoundColumn> 
                      
                    <telerik:GridDropDownColumn HeaderStyle-Width="50" ItemStyle-Width="50" ColumnEditorID="PhoneTypeNameEditor" UniqueName="ddlPhoneTypeID" ListTextField="PhoneTypeName"   
                    ListValueField="PhoneTypeID" DataSourceID="PhoneTypeList" HeaderText="" DataField="PhoneTypeID">  
 
                    </telerik:GridDropDownColumn> 
                      
                    <telerik:GridCheckBoxColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="35" ItemStyle-Width="35" DataField="isPreferred" HeaderText="Preferred" UniqueName="isPreferred">  
 
                    </telerik:GridCheckBoxColumn> 
 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25">  
                      
                    </telerik:GridEditCommandColumn> 
                
                    <telerik:GridClientDeleteColumn ConfirmText="Are you sure you want to delete?" ButtonType="ImageButton" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25">  
                      
                    </telerik:GridClientDeleteColumn> 
                      
                </Columns> 
 
            </MasterTableView> 
            </telerik:RadGrid> 
 
            <telerik:GridTextBoxColumnEditor ID="PhoneNumberEditor" runat="server">  
                <TextBoxStyle Width="90" /> 
            </telerik:GridTextBoxColumnEditor> 
            <telerik:GridDropDownListColumnEditor ID="PhoneTypeNameEditor" runat="server">  
                <DropDownStyle Width="65" /> 
            </telerik:GridDropDownListColumnEditor> 
 
            <asp:ObjectDataSource ID="PhoneList" runat="server" SelectMethod="psPhoneList" TypeName="Recruit.Data.PeopleDAL.PeopleMainDAL">  
                <SelectParameters> 
                    <asp:QueryStringParameter DefaultValue="0" Name="PeopleID" QueryStringField="pid" Type="Int64" /> 
                </SelectParameters> 
            </asp:ObjectDataSource> 
 
            <asp:ObjectDataSource ID="PhoneTypeList" runat="server" SelectMethod="psPhoneTypeList" TypeName="Recruit.Data.PeopleDAL.PeopleMainDAL">  
            </asp:ObjectDataSource> 

Here is my code:

 
        protected void PhoneGrid_OnUpdateCommand(object source, GridCommandEventArgs e)  
        {  
 
            GridEditableItem editedItem = e.Item as GridEditableItem;  
 
            //Get the primary key value using the DataKeyValue.       
            if (editedItem != null)  
            {  
                var P = new Phone();  
                P.PhoneID = (Int64)editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["PhoneID"];  
                //Access the textbox from the edit form template and store the values in string variables.       
                P.PhoneNumber = (editedItem["PhoneNumber"].Controls[0] as TextBox).Text;  
 
                // ATTEMPT TWO - I get Unable to cast object of type 'Telerik.Web.UI.RadComboBox' to type 'System.Web.UI.WebControls.DropDownList'.  
                DropDownList ddl = (DropDownList)editedItem["ddlPhoneTypeID"].Controls[0];  
                string selectedVal = ddl.SelectedValue;  
                P.PhoneTypeID = Convert.ToInt32(selectedVal);  
                  
                // ATTEMPT One - I get NULL here  
                //P.PhoneTypeID = Convert.ToInt32((editedItem["PhoneTypeID"].Controls[0] as DropDownList).SelectedValue);  
                P.isPreferred = (editedItem["isPreferred"].Controls[0] as CheckBox).Checked;  
 
                PeopleMainDAL.puPhoneList(P);  
            }  
 
        }  
 


I am trying to get the value from the drop down list upon edit and I am either getting a null exception or the second attempt I was getting a casting error.  Help!
Drew Auman
Top achievements
Rank 1
 answered on 24 Sep 2009
3 answers
102 views
Hey guys, dont suppose you can help me, im getting some odd issues with a RadEditor that is nested in a RadSplitter.

1) In internet explorer on local machine the resizing works fine, however in firefox it doesnt seem to be working
2) (see image) As you can see in firefox the internal size of the editor isn't resizing
3) Also, i found if you do a partial postback the page starts working!

I cant see why its doing this, any help would be awesome!

Image:
http://x-volt.com/pics/TelerikError1.png

Source (aspx only):
http://x-volt.com/hosting/editor.rar

Thanks,

Simon
Simon Colmer
Top achievements
Rank 1
 answered on 24 Sep 2009
3 answers
241 views

Hi,

1. I am trying to create a appointment in month view.

2. I am using custom insert appointment

3. I am tried the code for getting selected date (RadScheduler1.SelectedDate.ToString("MM/dd/yyyy")) I am not able toget the selected date, get the current date

4. I would like to get the selected date in scheduler monthview from server side

Thanks

Sabarish

Mr. Plinko
Top achievements
Rank 1
 answered on 24 Sep 2009
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?