Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
166 views
I tried the http://www.telerik.com/help/aspnet-ajax/grid-hide-expand-collapse-images-when-no-records.html way of hiding the expand/collapse image but with no success. I don't use the HierarchyLoadMode = ServerBind way of populating the details table - but I don't have a problem populating the details table.

Here is the code for the detail table bind and my attempt to hide the collapse/expand column for parent rows with no detail items:

Private Sub RadGridEvents_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles RadGridEvents.DetailTableDataBind
        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
        Select Case e.DetailTableView.Name
            Case "EventMerchantList"
                Dim EventID As Integer = dataItem.GetDataKeyValue("eventID")
                Dim eventML As List(Of Merchant)
                eventML = Merchant.GetAllMerchantsByEventID(EventID)
                If Not eventML Is Nothing Then
                    If eventML.Count > 0 Then
                        e.DetailTableView.DataSource = eventML
                    End If
                End If
        End Select
    End Sub
 
    Protected Sub RadGridEvents_PreRender(ByVal sender As Object, ByVal e As EventArgs)
        HideExpandColumnRecursive(RadGridEvents.MasterTableView)
    End Sub
    Public Sub HideExpandColumnRecursive(ByVal tableView As GridTableView)
        Dim nestedViewItems As GridItem() = tableView.GetItems(GridItemType.NestedView)
        For Each nestedViewItem As GridNestedViewItem In nestedViewItems
            For Each nestedView As GridTableView In nestedViewItem.NestedTableViews
                If nestedView.Items.Count = 0 Then
                    Dim cell As TableCell = nestedView.ParentItem("ExpandColumn")
                    cell.Controls(0).Visible = False
                    nestedViewItem.Visible = False
                End If
                If nestedView.HasDetailTables Then
                    HideExpandColumnRecursive(nestedView)
                End If
            Next
        Next
    End Sub

It seems like this should be an easy thing to do but I cannot find the answer. Thanks in advance for any help I get with this.
Marin
Telerik team
 answered on 26 May 2011
2 answers
193 views
Dear Sir:
 I have a telerik gird and I would like to add tool tip in grid with add control during itemDataBound. it is ok for the static control in the grid template but if i try to dynamic  add control with tool tip manager during grid itemDataBound and the tool tip didn't show up.

will you have any sample which i can follow or any correction for my coding?

Thank you very much for your support!

From Edmond
protected void grdOwnerHistory_ItemDataBound(object sender, GridItemEventArgs e)
   {
       STEPS_AdditionalOwner_DataAdapter additionalDA = new STEPS_AdditionalOwner_DataAdapter();
       STEPS_Client_DataAdapter clientDA = new STEPS_Client_DataAdapter();
        if (e.Item is GridHeaderItem)
       {
           GridHeaderItem headerItem = (GridHeaderItem)e.Item;
       }
        else if (e.Item is GridDataItem)
        {
            GridDataItem dataItem = (GridDataItem)e.Item;
            if (!Object.Equals(this.RadToolTipManager1, null))
            {
                RadToolTipManager1.TargetControls.Add(((HyperLink)dataItem["Owner_Name"].FindControl("lnkOwner_Name")).ClientID, "Owner_Name|" + dataItem["Owner_ID"].Text.Replace(" ", "").Replace("<nobr>", "").Replace("</nobr>", ""), true);
                //((HyperLink)dataItem["Owner_Name"].FindControl("lnkOwner_Name")).Font.Underline = true;
                DataSet ds = additionalDA.getAdditionalOwnerByTenureId(long.Parse(dataItem["Tenure_Id"].Text));
                foreach (DataRow dRow in ds.Tables[0].Rows){
                    DataSet clientDS = clientDA.GetClientById(CommonFunction.ConvertIDToInt64( dRow["Owner_Id"]), long.Parse(this.employeeId));
                      
                    string clientName;
                    if (clientDS.Tables[0].Rows.Count > 0){
                       clientName  = clientDS.Tables[0].Rows[0]["Rn_Descriptor"].ToString();
                         
                       HyperLink link = new HyperLink();
                       link.Text = clientName;
                       RadToolTipManager1.TargetControls.Add(link.ClientID, "Owner_Name|" + dRow["Owner_Id"].ToString(), true);
                       dataItem["Owner_Name"].Controls.Add(link);
                        
                         
                    }
                }
            }
        }
   }
CH
Top achievements
Rank 1
 answered on 26 May 2011
2 answers
90 views
Hello,
   We are currently using a RadComboBox with loadOnDemand within our MasterPage.   The SelectedValue of the ComboBox and the SelectedText are properly returned to the SelectedIndexChanged Event when a combobox item is selected from the drop down for the first time but not upon the second selection.  To be more clear.  If you have 3 ComboboxItems (in our case "projects")  : Item 1, Item 2 and Item3.  If Item 1 is selected the SelectedIndexChangedEvent works as expected.  Both the Text and Value of the event are populated in the event handler as expected, If Item 2 is selected the same expected behavior occurs.  If however a user were to RE select Item 1 after previously selecting Item 1 during the same session then ONLY the Text of the event handler is populated in the event value is not populated.  To make matters slightly more confusing the SelectedValue of the combo Box is also returning an empty string only on the reselection but appears to be working properly for the initial selection..  I have no idea why everything seems to be working fine for the first iteration of a selection but not the second.  Any advice would be sincerely appreciated.  Relevant Code Below:

C#

  protected void rcbCurrentProject_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
                     
            var projects = FluxPermissionManager.GetUserProjectAccess(Page.User.Identity.Name).Select(lkj => new { name = lkj.name, testProjectID = lkj.testProjectID });
            rcbCurrentProject.DataSource = projects.ToList();
            rcbCurrentProject.DataBind();

            e.Message = "Displaying All Accessible Projects";            
        }



    protected void rcbCurrentProject_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            try
            {
        //e.Text Is populated Properly.... no issues
        string projectName = e.Text
        
        //e.Value returns an empty string following the second time selected.
                int val = Int32.Parse(e.Value);

        . . . ...
          }

       }


ASPX

    <telerik:RadComboBox ID="rcbCurrentProject" runat="server" ErrorMessage="None Selected" EnableLoadOnDemand="true"
                                ShowMoreResultsBox="false" AutoPostBack="true" EnableVirtualScrolling="false" OnPreRender="rcbCurrentProject_PreRender"
                                DataTextField="name" DataValueField="testProjectID" OnItemsRequested="rcbCurrentProject_ItemsRequested"  
                                MarkFirstMatch="true" Filter="Contains" AllowCustomText="false" OnSelectedIndexChanged="rcbCurrentProject_SelectedIndexChanged"
                                OnClientDropDownOpening="cleanProjectDefaultSelection">
                            </telerik:RadComboBox>


      function cleanProjectDefaultSelection(sender, args) {
            if (sender.get_text() != "") {
                sender.set_text("");
                sender._filterText = "";
                sender.requestItems("");
            }
        }
Andrew
Top achievements
Rank 1
 answered on 26 May 2011
2 answers
160 views

I’d like to have a fixed height radeditor which will limit content input after the boundary of the radeditor is reached. However, after setting the Height (500px), EnableResize(false), and AutoResizeHeight(false) parameters scrollbars continue to appear and the page still accepts input indefinitely.


Is there actually a way to limit the amount of input by fixing the height of a radeditor?

Daniel
Top achievements
Rank 1
 answered on 26 May 2011
1 answer
136 views
Hi,

I have tried to use your treelist with a template column for displaying a checkbox.

I get the result that the template column is displayed but now I don't know how to get the check event for the checkboxes.

I use the treelist as member of a usercontrol. There will be multiple instances of this usercontrol on the page.
The content of the treeview will be rebuilt completely on Page_Load of the usercontrol.

Don't know what's going wrong here. Hope you'll have a sample for fixing it.

Sincerely

René


'on Page Load of the UserControl
  
            RadTreeList1.Style.Add(HtmlTextWriterStyle.Overflow, "auto")
  
  
            RadTreeList1.Width = mWidth
            RadTreeList1.Height = mHeight
  
            RadTreeList1.EditMode = TreeListEditMode.InPlace
            RadTreeList1.Enabled = True
  
            XmlDataSource1.DataFile = Path & "RowData.xml"
            RadTreeList1.Columns.Clear()
  
            Dim tmplt As New Web.UI.TemplateBuilder
  
  
            Dim selectColumn As New TreeListTemplateColumn
            selectColumn.DataField = "selected"
            selectColumn.EditItemTemplate = New CheckBoxTemplate("")
            selectColumn.ItemTemplate = New CheckBoxTemplate("")
  
            RadTreeList1.Columns.Add(selectColumn)
  
            Dim boundColumn As New TreeListBoundColumn
            boundColumn.DataField = "C2"
            boundColumn.UniqueName = "C2"
            boundColumn.HeaderText = "C2"
            RadTreeList1.Columns.Add(boundColumn)
  
  
    Private Sub RadTreeList1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.TreeListItemDataBoundEventArgs) Handles RadTreeList1.ItemDataBound 
        If TypeOf e.Item Is TreeListDataItem Then
            Dim dataItem As TreeListDataItem = e.Item
            Dim cb As Web.UI.WebControls.CheckBox
            cb = dataItem.FindControl("templateColumnCheckBox")
            AddHandler cb.CheckedChanged, AddressOf CheckBox1_CheckedChanged
            cb.Checked = True
        End If
    End Sub
  
    Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
        'never get this event....
    End Sub
  
Public Class CheckBoxTemplate
    Implements System.Web.UI.ITemplate
  
    Private CheckBox As System.Web.UI.WebControls.CheckBox
    Private colname As String
  
    Public Sub New(ByVal cName As String)
        colname = cName
    End Sub
  
    Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
        CheckBox = New System.Web.UI.WebControls.CheckBox
        CheckBox.ID = "templateColumnCheckBox"
        CheckBox.AutoPostBack = True
        container.Controls.Add(CheckBox)
    End Sub
End Class
Tsvetina
Telerik team
 answered on 26 May 2011
1 answer
45 views
I know I'd done this once before, but cannot find where, and can't seem to find the code online anywhere either.

I have a site with Telerik controls in it. There is one page with out any telerik controls on it, but I'd like to use some of the styles from RadGrid in this page. I know there was a way to get the URL to include a specific control/skin stylesheet in your page so you could use the styles without having that particular control on your page.

What was the method to get the url?

Thanks in advance!
Shinu
Top achievements
Rank 2
 answered on 26 May 2011
0 answers
83 views
I have two radajaxpanel, one panel has all the controls and another has the submit button, when ever a submit button is clicked both the panels are re-loaded, All my validation controls and validation summary is placed in first panel.
When ever I'm clicking the button the validation summary displays and then disappears immediately, which I dont want. After panel loads the validation summary should be displayed if any validation are failed.

Appreciate your immediate reply, as I'm stuck because of this stupid ajax problem
Panks
Top achievements
Rank 1
 asked on 26 May 2011
6 answers
328 views

Hi,
  Can u suggest how to design the attached design using radgridview control.

  Is it possible to bind radgridview header from database.

Regards
Ravi
Brian
Top achievements
Rank 1
 answered on 26 May 2011
2 answers
63 views
How i would get week no in current year.
For instance:
Week 1 = Jan 1 - Jan 2
Week 2 = Jan 3 - Jan 9
Mark de Torres
Top achievements
Rank 1
 answered on 26 May 2011
0 answers
83 views
Currently i have develop Scheduler correctly. However, i have difficulty if the start date and end date changed.

Originally
start = '24-01-2011'
end =' 16-12-2011'

i need to modified the above start and end date to the following

start1 = '24-01-2011'
end1 = '01-04-2011'

start2='11-04-2011'
end2 ='24-06-2011'

start3='25-07-2011'
end3='30-09-2011'

start4='10-10-2011'
end4='16-12-2011'

Please advise
Mark de Torres
Top achievements
Rank 1
 asked on 26 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?