Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
68 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.3K+ 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
113 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
129 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
1 answer
60 views
Is there a way I can use Autocomplete and the AutoCompleteSeparator to allow me to find items that contain all the values entered?

For example, I want to use the space as an AutoCompleteSeparator and if someone searches "human liver", I want it to match entries like "human liver cells" and "liver cells (human)", but not "liver cells (mouse)".

Is this possible?
Nencho
Telerik team
 answered on 25 Mar 2014
1 answer
54 views
Hi,
   My Grid has Two groupby Columns I'm able to Hide The The row . .(   $('#divDeliverySlotManager tbody .k-grouping-row:contains("DayValue")').hide();)

   and I'm unable to hide Column. please Find the Screen Capture (highlighted Column) .

   Thanks!!
Angel Petrov
Telerik team
 answered on 25 Mar 2014
3 answers
93 views
Currently I can load data into a Grid when a specific value is chosen from a ComboBox. When the page first loads it displays an empty grid though. I am trying to figure out how to have ALL values loaded onto the Grid when the user first visits the page. 

This demo provides an example of what I am trying to do but I can't quite get it to work:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridcomboajax/defaultcs.aspx?product=combobox



Here is my current code:

<%@ Page Title="Report" Language="C#" MasterPageFile="~/MasterPages/Site.Master" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="Report" Theme="Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
 
 
    <table>
        <tr>
            <td><label>User: </Label></td>
            <td>
                <telerik:RadComboBox ID="EmailRCB" runat="server" AutoPostBack="True" DataSourceID="dllDataSource"
                    DataTextField="email" DataValueField="email" Width="250px"
                    AppendDataBoundItems="true">
                    <Items>
                        <telerik:RadComboBoxItem Text="- Select User -" Value="0" Selected="true"></telerik:RadComboBoxItem>
                    </Items>
                </telerik:RadComboBox>
            </td>
        </tr>
    </table><br />
 
 
    <!-- grid -->
        <telerik:RadGrid ID="OrdersGrid" AllowPaging="true" DataSourceID="gridSource" runat="server"
            GridLines="None" AllowSorting="true" ShowFooter="true" PageSize = "1000" Width="1500" >
                    <PagerStyle AlwaysVisible="true" ShowPagerText="true" Position="TopAndBottom" />
        <MasterTableView DataSourceID="gridSource" AllowMultiColumnSorting="false">
            <NestedViewTemplate>
                <asp:Panel runat="server" ID="InnerContainer" Visible="true" ViewStateMode="Enabled">
                    <telerik:RadTabStrip runat="server" ID="tsMain" MultiPageID="mpMain" SelectedIndex="0">
                        <Tabs>
                            <telerik:RadTab runat="server" Text="Details" PageViewID="pvMain"  />
                        </Tabs>
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage runat="server" ID="mpMain" SelectedIndex="0" RenderSelectedPageOnly="false">
                        <telerik:RadPageView runat="server" ID="pvMain">
                            <asp:Label ID="lblNUM" Font-Bold="true" Font-Italic="true" Text='<%# Eval("NUMBER") %>' Visible="false" runat="server"></asp:Label>
                            <!-- inner/nested grid -->
                            <telerik:RadGrid runat="server" ID="grdOrders" DataSourceID="grdReportDataSource2" ShowFooter="false" AllowSorting="false" Width="700" EnableLinqExpressions="false">
                                <MasterTableView ShowHeader="true" AutoGenerateColumns="true" AllowPaging="False">
                                </MasterTableView>
                            </telerik:RadGrid>
                            <!-- datasource for inner/nested grid -->
                            <asp:SqlDataSource ID="grdReportDataSource2" runat="server"
                            ConnectionString="<%$ ConnectionStrings:intranetConnectionString %>"
                            SelectCommand="dbo.sp_AuditClientReportNested2" SelectCommandType="StoredProcedure" >
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="lblNUM" PropertyName="Text" Type="String" Name="NUM"></asp:ControlParameter>
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </telerik:RadPageView>
                    </telerik:RadMultiPage>
                </asp:Panel>
            </NestedViewTemplate>
        </MasterTableView>
        <ClientSettings AllowDragToGroup="false">
        </ClientSettings>
        </telerik:RadGrid>
 
    </div>
 
 
    <!-- datasource for RadComboBox -->
    <asp:SqlDataSource ID="dllDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:intranetConnectionString %>"
        SelectCommand="SELECT DISTINCT EMAIL FROM Table1"></asp:SqlDataSource>
    <!-- datasource for outer/header grid -->
    <asp:SqlDataSource ID="gridSource" runat="server" ConnectionString="<%$ ConnectionStrings:intranetConnectionString %>"
        SelectCommand=" SELECT DISTINCT NUM AS 'Number', EMAIL AS 'Email', BATCHID AS 'Batch ID', NAME AS 'Name', COMPANY AS 'Company', RTRIM(FIRSTNAME) + ' ' + RTRIM(LASTNAME) AS 'Contact Name', DateAdded AS 'Date'
                        FROM Table1
                        WHERE EMAIL = @email
                        ORDER BY NUM">
        <SelectParameters>
            <asp:ControlParameter Name="email" PropertyName="SelectedValue" ControlID="EmailRCB">
            </asp:ControlParameter>
        </SelectParameters>
    </asp:SqlDataSource>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="EmailRCB">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="OrdersGrid" LoadingPanelID="AjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="EmailRCB"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
 
 
 
 
</asp:Content>

Princy
Top achievements
Rank 2
 answered on 25 Mar 2014
2 answers
486 views
Hi -

I often call functions to generate content in my grids and lists.  When I do I always use the DataBinder.Eval() function to get specific fields from the data item and then I send those to my code behind function.  Is there a way to just send the entire data item?

For example below is what I put in my HTML and then the signature of the function in my code behind that takes that data and then generates what I'd like.  If possible I would like to just call CustomerListActions(DataItem As ObjectType).  Thanks!

Ken

HTML CODE
<telerik:GridTemplateColumn><br><%# CustomerListActions(DataBinder.Eval(Container.DataItem, "ID"), DataBinder.Eval(Container.DataItem, "IsDeleted"), DataBinder.Eval(Container.DataItem, "CompanyName"))%><br></telerik:GridTemplateColumn><br>

Function Signature in Code Behind
Public Function CustomerListActions(lngID As Long, intIsDeleted As Integer, strCompanyName As StringAs String<br>End Function
Ken
Top achievements
Rank 1
 answered on 25 Mar 2014
0 answers
74 views
Hi!

    I have a telerik grid, which have columns - Name, Address, Employer.
    Employer is binded by an ID. I want these columns to be Sortable. Address and Name works fine. But for Employer, it is not sorting by Employer(or text), but
    rather it is sorting by the ID.


 @(Html.Telerik().Grid<Customer>(Model)
            .Name("CustomerGrid")
            .ClientEvents(e => e.OnRowDataBound("Grid_onRowDataBound"))
            .Columns(columns =>
            {
                
                columns.Bound(customer => customer.Address).Title("Address");
                columns.Bound(customer => customer.Name).Title("Name");
                columns.Bound(customer => ID).Title("Employer");
            })
            .Pageable(p => p.PageSize(10))
            .Filterable(filtering => filtering.Enabled(false))
            .Sortable(s => s.SortMode(GridSortMode.SingleColumn)))
 


Eg-      Name     Address       Employer
    
           Abc         west street    IBM [id 2] 
           Xyz         111 street      GE [id 3]
           Pqr         north street     Microsoft [id 1]
     


After sorting by Employer i.e by employer name column it  should be--

         Name       Address       Employer
    
         Xyz          111 street     GE [id 3]
         Abc         west street    IBM [id 2] 
         Pqr          north street   Microsoft [id 1]
         
         
abc
Top achievements
Rank 1
 asked on 25 Mar 2014
0 answers
91 views
Is it possible to do multiple reports on tabs in a single Telerik report? I want to create an Excel type report book where each report is associated with a tab. This means that if i click on a tab it opens a report associated with the specific tab. I thought I can do this using report book. So far no luck. This is what i have so far :

reportbook myReportBook = new Reportbook();
reportbook.reports.add(testreport1);
reportbook.reports.add(testreport2);
reportbook.reports(0).documentMapText = "Testing Report1";
reportbook.reports(1).documentMapText = " Testing Report2";

Reportviewer.Reportsource = reportbook;

I can see the report books on the side panel of the page. Is it possible to have it at the bottom as tabs. Just like in Excel. If it is possible how would you do it ?

Thanks
St
Top achievements
Rank 1
 asked on 24 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?