Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
70 views
Hi,

In prior versions (prior to Q1 2014) the TreeList control would work with Height = "100%", now it downsizes to just 1 row.

Is this by design or a bug - any work around for it?

Regards

Jon
Jon
Top achievements
Rank 1
 answered on 25 Mar 2014
1 answer
54 views
Hello,
I want to set only preview mode with print option only.
Rumen
Telerik team
 answered on 25 Mar 2014
1 answer
117 views
i am programatically create radeditor and set it content and convert into pdf below is the code. but give following error
RadEditor radEdit = new RadEditor();
                radEdit.SkinID = "DefaultSetOfTools";
                radEdit.ContentFilters = EditorFilters.DefaultFilters;
                radEdit.ContentFilters = EditorFilters.PdfExportFilter;
               radEdit.Content= MakeTable();
                radEdit.ExportSettings.OpenInNewWindow=true;
               radEdit.ExportToPdf();

 ERROR : at Telerik.Web.UI.RadEditor.ExportToPdf() give error  Object reference not set to an instance of an object.

please give tell me how do i reslove this issue. ASAP.
Ianko
Telerik team
 answered on 25 Mar 2014
1 answer
61 views
Hello

Is there a way to create layouts like Sitefinity allow you too?  What Telerik controls would I use?  Is there an example?

Thanks,

Example of what I am looking for:
http://www.sitefinity.com/product/drag-drop-layouts
Ivan Zhekov
Telerik team
 answered on 25 Mar 2014
2 answers
120 views
Hi,
I use a hierarchical radgrid and I do insert and update in parent and child table. To enter and insert I use Web User Control and update is working properly. The problem is following: When I do an insert I can not get the Parent ID from current parent row. There are some solutions on the forum but I did not managed to implement in my case (ascx). What is the best way to get ParentID from Child table Web User Control?

Thank you
Samir
Top achievements
Rank 1
 answered on 25 Mar 2014
2 answers
35 views
Hi,

We are using the telerik combobox in SharePoint 2010. Basically, a SharePoint modal dialog window is opened and in that dialog window we are displaying a combobox control. It works fine in most browsers but there seems to be an issue with IE8 and the options of the combobox open in a completely different place.

Please view the screenshot. It is happening only in the dialog window. Looking at it, it seems  It's because IE8 recognises the modal dialog as requiring display in compatibility mode, which breaks the boxes.

In the screen shot the options should appear under division and department combobox.
Hristo Valyavicharski
Telerik team
 answered on 25 Mar 2014
1 answer
97 views
Hi Sir/Ma'am

I have a problem when adding and editing in the treelist, the column automatically shrink and giving me a empty white space in the right side, see the attached image

Thanks and Regards,
<telerik:RadAjaxPanel ID="pnl" runat="server">
    <telerik:RadTreeList ID="rdlMenu" Skin="Office2007" runat="server" DataKeyNames="Id" ParentDataKeyNames="ParentId" AutoGenerateColumns="false" OnItemCommand="rdlMenu_ItemCommand" OnNeedDataSource="rdlMenu_NeedDataSource"
        OnInsertCommand="rdlMenu_InsertCommand" OnItemCreated="rdlMenu_ItemCreated">
        <Columns>
            <telerik:TreeListEditCommandColumn UniqueName="InsertCommandColumn" ButtonType="ImageButton" ShowEditButton="false" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px"></telerik:TreeListEditCommandColumn>
            <telerik:TreeListBoundColumn DataField="Id" UniqueName="Id" HeaderText="Id" Display="false">
            </telerik:TreeListBoundColumn>
            <telerik:TreeListBoundColumn DataField="ParentId" UniqueName="ParentId" HeaderText="ParentId" Display="false">
            </telerik:TreeListBoundColumn>
            <telerik:TreeListBoundColumn DataField="Position" UniqueName="Position" HeaderText="Position">
            </telerik:TreeListBoundColumn>
            <telerik:TreeListBoundColumn DataField="Description" UniqueName="Description" HeaderText="Descriptionn">
            </telerik:TreeListBoundColumn>
            <telerik:TreeListBoundColumn DataField="URL" UniqueName="URL" HeaderText="URL">
            </telerik:TreeListBoundColumn>
            <telerik:TreeListBoundColumn DataField="Division" UniqueName="Division" HeaderText="Division">
            </telerik:TreeListBoundColumn>
            <telerik:TreeListBoundColumn DataField="Escalation" UniqueName="Escalation" HeaderText="Escalation">
            </telerik:TreeListBoundColumn>
            <telerik:TreeListBoundColumn DataField="IsPortalAdmin" UniqueName="IsPortalAdmin" HeaderText="IsPortalAdmin">
            </telerik:TreeListBoundColumn>
 
            <telerik:TreeListButtonColumn CommandName="Edit" Text="Edit" UniqueName="EditCommandColumn" ButtonType="ImageButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="80px"></telerik:TreeListButtonColumn>
            <telerik:TreeListButtonColumn UniqueName="DeleteCommandColumn" Text="Delete" CommandName="Delete" ButtonType="ImageButton" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="80px"></telerik:TreeListButtonColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <div class="editTemplate">
                    <asp:HiddenField ID="hdnId" runat="server" Value='<%# Bind("Id") %>' />
                    <asp:HiddenField ID="hdnParentId" runat="server" Value='<%# Bind("ParentId") %>' />
                    <table>
                        <tr>
                            <td>Position</td>
                            <td>
                                <asp:TextBox ID="txtPosition" Text='<%# Bind("Position") %>' runat="server" Width="30px">
                                </asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>Description:
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="txtDescription" Text='<%# Bind("Description") %>' runat="server" Width="100%">
                                </asp:TextBox>
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>URL:
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtURL" Text='<%# Bind("URL") %>' runat="server" Width="100%">
                                </asp:TextBox>
                            </td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>Division:
                            </td>
                            <td>
                                <asp:TextBox ID="txtDivision" Text='<%# Bind("Division") %>' runat="server" Width="100%">
                                </asp:TextBox>
                            </td>
                            <td>Escalation:
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox4" Text='<%# Bind("Escalation") %>' runat="server">
                                </asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>IsPortalAdmin:                                  
                            <asp:CheckBox ID="chkAdmin" runat="server" />
                            </td>
                            <td></td>
                            <td>
                                <telerik:RadButton ID="btnUpdate" Text='<%# (Container is TreeListEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" CommandName='<%# (Container is TreeListEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                                    Icon-PrimaryIconCssClass="rbOk">
                                </telerik:RadButton>
 
                                <telerik:RadButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                    CommandName="Cancel" Icon-PrimaryIconCssClass="rbCancel">
                                </telerik:RadButton>
                            </td>
                        </tr>
                    </table>
                </div>
            </FormTemplate>
        </EditFormSettings>
    </telerik:RadTreeList>
Galin
Telerik team
 answered on 25 Mar 2014
7 answers
1.4K+ views
Hi there.I have a RadGrid With 2 linkbuttons in CommandItemTemplate .i have a panel too that  when user click on row,it become visible . i want to visible these linkbuttons when this panel is visible.Anyone has ideas?
Kostadin
Telerik team
 answered on 25 Mar 2014
1 answer
144 views
I am using  Rad Drop down tree  with check box in this drop down tree have multi parents  when i check the check box checked all child nodes  value  input to the radgrid 

when check the 2nd parent check box  that child node checked at the same time radgrid  refresh  the sample code in client side  and server side
Aneliya Petkova
Telerik team
 answered on 25 Mar 2014
4 answers
159 views
Hello All,

It is working fine in Development and once I publish it throws this error and it is not really telling me anything: 
sys.webforms.pagerequestmanagerservererrorexception: an unknown error occurred while processing the request on the server. the status code returned from the server was: 500
It was working fine in older version but when I upgraded to 2008.3 1125, it started throwing that error. I have tried 

EnableEventValidation

 

="false"  on the Main page; as the RadGrid is running on a user controler inside the Admin page here is the code and HTML of the user controler...

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="PersonAdmin.ascx.vb" Inherits="PersonAdmin" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<script language="javascript" type="text/javascript">        
          Sys.Application.add_load(function()        
          {        
            var form = Sys.WebForms.PageRequestManager.getInstance()._form;        
            formform._initialAction = form.action = window.location.href;        
          });        
  </script>    
<table> 
    <tr> 
        <td style="width: 3px">  
        </td> 
        <td bgcolor="#ce9426">  
            <strong><span style="font-size: 10pt; color: white">Phone Personnal Admin</span></strong></td> 
    </tr> 
    <tr> 
        <td style="width: 3px">  
        </td> 
        <td> 
            <asp:Label ID="lblResult" runat="server" ForeColor="#C04000"></asp:Label></td>  
    </tr> 
    <tr> 
        <td style="width: 3px">  
        </td> 
        <td> 
            <telerik:RadGrid ID="rgPersonAdmin" runat="server" AllowSorting="True" 
                AutoGenerateColumns="False" GridLines="None" Skin="WebBlue" OnItemCommand="rgPersonAdmin_ItemCommand" OnPreRender="rgPersonAdmin_PreRender">  
                <MasterTableView CommandItemDisplay="Top" DataKeyNames="PersonID,PersonIndic,DepName,DepUniID,ContactUniID,RelationUniID">  
                    <Columns> 
                        <telerik:GridBoundColumn DataField="PersonID" Display="False" HeaderText="PersonID" 
                            ReadOnly="True" UniqueName="PersonID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="DepUniID" Display="False" HeaderText="DepUniID" 
                            ReadOnly="True" UniqueName="DepUniID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ContactUniID" Display="False" HeaderText="ContactUniID" 
                            ReadOnly="True" UniqueName="ContactUniID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="RelationUniID" Display="False" HeaderText="RelationUniID" 
                            ReadOnly="True" UniqueName="RelationUniID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ContactType" Display="False" HeaderText="ContactType" 
                            ReadOnly="True" UniqueName="ContactType">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridEditCommandColumn HeaderText="Edit" UniqueName="EditCommandColumn1">  
                        </telerik:GridEditCommandColumn> 
                        <telerik:GridTemplateColumn HeaderText="LastName" SortExpression="LastName" UniqueName="TemplateColumn">  
                            <ItemTemplate> 
                                <asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LastName") %>'></asp:Label> 
                            </ItemTemplate> 
                            <EditItemTemplate> 
                                <asp:TextBox ID="tbLastName" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox><span 
                                    style="color: Red">*</span> 
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbLastName" 
                                    ErrorMessage="This field is required">  
                                </asp:RequiredFieldValidator> 
                            </EditItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="FirstName">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="EmployeeID" HeaderText="EmployeeID" UniqueName="EmployeeID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Ext" HeaderText="Ext" UniqueName="Ext">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Pager" HeaderText="Pager/Mobile" UniqueName="Pager">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Office" HeaderText="Office" UniqueName="Office">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Fax" HeaderText="Fax" UniqueName="Fax">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="IP" HeaderText="IP" UniqueName="IP">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridTemplateColumn DataField="DepName" HeaderText="Dep Name" UniqueName="DepName">  
                            <ItemTemplate> 
                                <asp:Label ID="lblDep" runat="server"></asp:Label> 
                            </ItemTemplate> 
                            <EditItemTemplate> 
                                <asp:DropDownList ID="DepNameddl" runat="server">  
                                </asp:DropDownList> 
                            </EditItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridBoundColumn DataField="Role" HeaderText="Role" UniqueName="Role">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridTemplateColumn AllowFiltering="False" DataField="PersonIndic" HeaderText="Active" 
                            UniqueName="PersonIndic">  
                            <ItemTemplate> 
                                <asp:CheckBox ID="cbPersonIndic" runat="server" Enabled="false" /> 
                            </ItemTemplate> 
                            <EditItemTemplate> 
                                <asp:CheckBox ID="PersonIndicCB" runat="server" Checked='<%# Bind("PersonIndic")%>' /> 
                            </EditItemTemplate> 
                        </telerik:GridTemplateColumn> 
                    </Columns> 
                    <RowIndicatorColumn Visible="False">  
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn Visible="False">  
                        <HeaderStyle Width="19px" /> 
                    </ExpandCollapseColumn> 
                </MasterTableView> 
            </telerik:RadGrid></td>  
    </tr> 
    <tr> 
        <td style="width: 3px">  
        </td> 
        <td> 
            <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="rgPersonAdmin">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="rgPersonAdmin" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                            <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManagerProxy> 
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Maximize, Close, resize" 
                DestroyOnClose="True" Height="400px" Left="" MinimizeZoneID="HorizontalMinimize" 
                Modal="True" Title="" Top="" Width="600px">  
                <Windows> 
                    <telerik:RadWindow ID="RadWindow1" runat="server" Left="" NavigateUrl="RadPhys.aspx" 
                        Title="Physician Information" Top="">  
                    </telerik:RadWindow> 
                </Windows> 
            </telerik:RadWindowManager> 
            </td> 
    </tr> 
    <tr> 
        <td style="width: 3px">  
        </td> 
        <td> 
            <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label></td>  
    </tr> 
</table> 
 
Imports System.Data  
Imports Telerik.Web.UI  
Imports System.Collections  
Imports System.Data.SqlClient  
Imports System.Web.UI  
Imports System.Web.UI.WebControls  
Imports System.Web.UI.WebControls.WebParts  
Imports System.Web.UI.HtmlControls  
Imports System.Security.Principal  
Imports AjaxControlToolkit  
Partial Class PersonAdmin  
    Inherits System.Web.UI.UserControl  
    Public dataConn As New PhoneBookDLL.dl  
 
    Shared shouldDisableCommandItem As Boolean = False 
    Shared shouldDisableEditItems As Boolean = False 
 
 
    Protected Sub rgPersonAdmin_Init(ByVal sender As ObjectByVal e As System.EventArgs) Handles rgPersonAdmin.Init  
        Dim menu As GridFilterMenu = rgPersonAdmin.FilterMenu  
        Dim i As Integer = 0  
        While i < menu.Items.Count  
            If menu.Items(i).Text = "NoFilter" Or menu.Items(i).Text = "Contains" Or menu.Items(i).Text = "EqualTo" Or menu.Items(i).Text = "StartsWith" Or _  
         menu.Items(i).Text = "EndsWith" Then 
                i = i + 1  
            Else 
                menu.Items.RemoveAt(i)  
            End If 
        End While 
    End Sub 
 
    Protected Sub rgPersonAdmin_InsertCommand1(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgPersonAdmin.InsertCommand  
        If TypeOf e.Item Is GridDataItem Then 
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)  
            Dim strChk As String = item.GetDataKeyValue("PersonIndic").ToString()  
            Dim chkbx As CheckBox = DirectCast(item("PersonIndic").FindControl("cbPersonIndic"), CheckBox)  
            If strChk = "0" Then 
                chkbx.Checked = False 
            Else 
                chkbx.Checked = True 
            End If 
            Dim lbl As Label = DirectCast(item("DepName").FindControl("lblDep"), Label)  
            Dim DepNameDB As String = item.GetDataKeyValue("DepName").ToString()  
            If DepNameDB = System.DBNull.Value.ToString Then 
                lbl.Text = "" 
            Else : lbl.Text = DepNameDB  
            End If 
 
            Dim tbLastNamestr As TextBox = DirectCast(item("TemplateColumn").FindControl("tbLastName"), TextBox)  
            Dim LastNameDB As String = item.GetDataKeyValue("LastName").ToString()  
            If LastNameDB = System.DBNull.Value.ToString Then 
                tbLastNamestr.Text = "" 
            Else : tbLastNamestr.Text = LastNameDB  
            End If 
 
        End If 
        Dim insertedItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)  
        'Dim LastName As String = (TryCast(insertedItem("LastName").Controls(0), TextBox)).Text  
        Dim tbLastName As TextBox = DirectCast(insertedItem("TemplateColumn").FindControl("tbLastName"), TextBox)  
        Dim LastName As String = tbLastName.Text  
 
        Dim FirstName As String = (TryCast(insertedItem("FirstName").Controls(0), TextBox)).Text  
        Dim EmployeeID As String = (TryCast(insertedItem("EmployeeID").Controls(0), TextBox)).Text  
        Dim Ext As String = (TryCast(insertedItem("Ext").Controls(0), TextBox)).Text  
        Dim Pager As String = (TryCast(insertedItem("Pager").Controls(0), TextBox)).Text  
        Dim Office As String = (TryCast(insertedItem("Office").Controls(0), TextBox)).Text  
        Dim Fax As String = (TryCast(insertedItem("Fax").Controls(0), TextBox)).Text  
        Dim IP As String = (TryCast(insertedItem("IP").Controls(0), TextBox)).Text  
 
        Dim chkbx1 As CheckBox = DirectCast(insertedItem("PersonIndic").FindControl("PersonIndicCB"), CheckBox)  
        Dim Indic As Integer 
        If chkbx1.Checked = True Then 
            Indic = 1  
        Else 
            Indic = 0  
        End If 
 
        Dim ddlbx As DropDownList = DirectCast(insertedItem("DepName").FindControl("DepNameddl"), DropDownList)  
        Dim DepUniID As Integer 
        DepUniID = ddlbx.SelectedValue  
 
        Dim Role As String = (TryCast(insertedItem("Role").Controls(0), TextBox)).Text  
 
        Dim u As String = My.User.Name  
        Dim c As String = My.Computer.Name  
 
        Dim PersonID, result As Integer 
        PersonID = dataConn.PhoneInsPerson(LastName, FirstName, EmployeeID, Indic, u, c)  
 
        If PersonID <> -1 Then 
            result = dataConn.PhoneInsContact(2, PersonID, Ext, Pager, Office, Fax, "", IP, u, c)  
            result = result - dataConn.PhoneInsDepRel(DepUniID, PersonID, 2, 1, Role, u, c)  
        End If 
 
    End Sub 
 
    Protected Sub rgPersonAdmin_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgPersonAdmin.ItemCommand  
        If (e.CommandName = RadGrid.InitInsertCommandName) Then 
            'cancel the default operation  
            e.Canceled = True 
 
            'Prepare an IDictionary with the predefined values  
            Dim newValues As System.Collections.Specialized.ListDictionary = New System.Collections.Specialized.ListDictionary()  
            '' ''newValues("ContactName") = "default contact name"  
            '' ''newValues("CompanyName") = " default company name"  
 
            'set default value for the dropdown list inside the EditItemTemplate  
            newValues("DepUniID") = "1" 
            'set default checked state for checkbox inside the EditItemTemplate  
            newValues("PersonIndic") = "1" 
 
            'Insert the item and rebind  
            e.Item.OwnerTableView.InsertItem(newValues)  
        End If 
 
        If e.CommandName = RadGrid.EditCommandName Then 
            shouldDisableCommandItem = True 
        ElseIf e.CommandName = RadGrid.InitInsertCommandName Then 
            shouldDisableEditItems = True 
            'ElseIf e.CommandName = RadGrid.CancelCommandName Then  
        Else 
            shouldDisableCommandItem = False 
            shouldDisableEditItems = False 
        End If 
    End Sub 
 
    Protected Sub rgPersonAdmin_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgPersonAdmin.ItemDataBound  
        If TypeOf e.Item Is GridDataItem Then 
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)  
            Dim strChk As String = item.GetDataKeyValue("PersonIndic").ToString()  
            Dim chkbx As CheckBox = DirectCast(item("PersonIndic").FindControl("cbPersonIndic"), CheckBox)  
            If strChk = "0" Then 
                chkbx.Checked = False 
            Else 
                chkbx.Checked = True 
            End If 
            Dim lbl As Label = DirectCast(item("DepName").FindControl("lblDep"), Label)  
            Dim DepNameDB As String = item.GetDataKeyValue("DepName").ToString()  
            If DepNameDB = System.DBNull.Value.ToString Then 
                lbl.Text = "" 
                Label1.Text = "0" 
            Else 
                lbl.Text = DepNameDB  
                Label1.Text = CType(item.GetDataKeyValue("DepUniID"), String)  
            End If 
        End If 
        'dropdownlist  
        If (TypeOf e.Item Is GridEditableItem AndAlso CType(e.Item, GridEditableItem).IsInEditMode) Then 
            Dim edititem As GridEditableItem = DirectCast(e.Item, GridEditableItem)  
            Dim ddl As DropDownList = DirectCast(edititem("DepName").FindControl("DepNameddl"), DropDownList)  
            Dim getDS As New DataSet  
            getDS = dataConn.PhoneGetDepDDL()  
            ddl.DataSource = getDS.Tables(0).DefaultView  
            ddl.DataTextField = "DepName" 
            ddl.DataValueField = "DepID" 
            ddl.DataBind()  
 
            Dim chosen As String 
            chosen = Label1.Text  
            If chosen = System.DBNull.Value.ToString Or chosen = 0 Then 
                ddl.SelectedValue = 0  
            Else 
                ddl.SelectedValue = chosen  
            End If 
        End If 
    End Sub 
 
    Protected Sub rgPersonAdmin_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgPersonAdmin.NeedDataSource  
        Dim getDS As New DataSet  
        getDS = dataConn.PhoneAllPerson()  
        rgPersonAdmin.DataSource = getDS.Tables(0).DefaultView  
    End Sub 
 
    Protected Sub rgPersonAdmin_PreRender(ByVal sender As ObjectByVal e As System.EventArgs) Handles rgPersonAdmin.PreRender  
        If shouldDisableEditItems Then 
            For Each dataItem As GridDataItem In rgPersonAdmin.MasterTableView.Items  
                TryCast(dataItem("EditCommandColumn1").Controls(0), LinkButton).Enabled = False 
            Next 
        ElseIf shouldDisableCommandItem Then 
            Dim commandItem As GridCommandItem = DirectCast(rgPersonAdmin.MasterTableView.GetItems(GridItemType.CommandItem)(0), GridCommandItem)  
            commandItem.Enabled = False 
        End If 
    End Sub 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        Page.Title = "Phonebook Personnel Admin" 
    End Sub 
 
    Protected Sub rgPersonAdmin_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgPersonAdmin.UpdateCommand  
        Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)  
 
        Dim strPersonID As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("PersonID").ToString()  
        Dim PersonID As Integer = CType(strPersonID, Integer)  
 
        Dim RelationUniID  
        Dim strRelationUniID As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("RelationUniID").ToString()  
        If strRelationUniID = "" Then 
            RelationUniID = "0" 
        Else : RelationUniID = CType(strRelationUniID, Integer)  
        End If 
 
        Dim strContactUniID As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("ContactUniID").ToString()  
        Dim ContactUniID As Integer = CType(strContactUniID, Integer)  
 
        'Dim LastName As String = (TryCast(editedItem("LastName").Controls(0), TextBox)).Text  
        Dim tbLastName As TextBox = DirectCast(editedItem("TemplateColumn").FindControl("tbLastName"), TextBox)  
        Dim LastName As String = tbLastName.Text  
 
        Dim FirstName As String = (TryCast(editedItem("FirstName").Controls(0), TextBox)).Text  
        Dim EmployeeID As String = (TryCast(editedItem("EmployeeID").Controls(0), TextBox)).Text  
        Dim Ext As String = (TryCast(editedItem("Ext").Controls(0), TextBox)).Text  
        Dim Pager As String = (TryCast(editedItem("Pager").Controls(0), TextBox)).Text  
        Dim Office As String = (TryCast(editedItem("Office").Controls(0), TextBox)).Text  
        Dim Fax As String = (TryCast(editedItem("Fax").Controls(0), TextBox)).Text  
        Dim IP As String = (TryCast(editedItem("IP").Controls(0), TextBox)).Text  
 
        'Dim DepName As String = (TryCast(editedItem("DepName").Controls(0), TextBox)).Text  
 
        Dim Role As String = (TryCast(editedItem("Role").Controls(0), TextBox)).Text  
 
        Dim item As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)  
        Dim chkbx As CheckBox = DirectCast(item("PersonIndic").FindControl("PersonIndicCB"), CheckBox)  
        Dim Indic As Integer 
        If chkbx.Checked = True Then 
            Indic = 1  
        Else 
            Indic = 0  
        End If 
 
        Dim ddlbx As DropDownList = DirectCast(item("DepName").FindControl("DepNameddl"), DropDownList)  
        Dim DepUniID As Integer 
        DepUniID = ddlbx.SelectedValue  
 
        Dim u As String = My.User.Name  
        Dim c As String = My.Computer.Name  
 
        Dim PersonIndic As String = CType(Indic, String)  
        Dim confirm As Integer 
        confirm = dataConn.PhoneEditPerson(PersonID, DepUniID, ContactUniID, LastName, FirstName, EmployeeID, Ext, Pager, Office, Fax, IP, PersonIndic, Role, RelationUniID, u, c)  
 
        Dim commandItem As GridCommandItem = DirectCast(rgPersonAdmin.MasterTableView.GetItems(GridItemType.CommandItem)(0), GridCommandItem)  
        commandItem.Enabled = True 
    End Sub 
End Class 
 

Thank you for all your help...
Shehab

Daniel
Telerik team
 answered on 25 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?