Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
139 views
I am having a bunch of issues trying to use data sources with radGrid nested views, therefore, I was wondering if there is an event I can intercept when clicking on the expand arrow so that I can, myself, retreive the data and display it for that particular item.

Also, when I do this, where should I store the information I get on other expanded items? Use a generic list and put it in the view state? If so, how would I render the whole grid when the postback is received? How do I walk through the hierarchy and update those items which where previously expanded?

Thanks

Sal
Tsvetina
Telerik team
 answered on 09 Aug 2011
3 answers
134 views

I have read the sample and it was very helpful, but I guess I am missing something, because I cannot get the third combo to update properly.

In the attached sample, I have 3 combos:  Content Area, Teacher Name, Student Name

When a user changes the Content Area, I want both combos to refresh.  It is a true cascade, because the teacher name also determines the list of students. 

For demo purposes, I have made it so the students lat names start with the same letter as their teachers.  So, if you select [Mathematics], not only should [Euler, Leonhard] appear (which it does), but also his first student [Edwards, Ernie].  This does not happen.  The student list remains for the previous teacher, until you manually change that second combo.

I am sure this is simple -- I am probably missing something on the control that would trigger the update to the third combo -- but I've been struggling with this for a few days now and need a more experienced set of eyes.

Suggestions are much appreciated!

Default.aspx

<form id="form1" runat="server">
  
    <telerik:RadScriptManager ID="ScriptManager1" runat="server" 
        EnableTheming="True">
    </telerik:RadScriptManager>
  
    <div>
  
        <table cellspacing="10px">
            <tr>
                <td>
                    Content Area<br />
                    <telerik:RadComboBox ID="cboContentAreas" runat="server" 
                        OnClientSelectedIndexChanging="cboTeachers_Load"
                        OnClientItemsRequested="ItemsLoaded"
                        OnItemsRequested="cboContentAreas_ItemsRequested"
                        Width="200px">
                    </telerik:RadComboBox>
                </td>
                <td>
                    Teacher<br />
                    <telerik:RadComboBox ID="cboTeachers" runat="server" 
                        OnClientSelectedIndexChanging="cboStudents_Load"
                        OnClientItemsRequested="ItemsLoaded"
                        OnItemsRequested="cboTeachers_ItemsRequested"
                        Width="200px">
                    </telerik:RadComboBox>
                </td>
                <td>
                    Student<br />
                    <telerik:RadComboBox ID="cboStudents" runat="server" 
                        OnItemsRequested="cboStudents_ItemsRequested"
                        OnClientItemsRequested="ItemsLoaded"
                        Width="200px">
                    </telerik:RadComboBox>
                </td>
            </tr>
        </table>                        
  
    </div>
  
    <!-- Client-side scripts for client side combo box refreshes -->
    <script type="text/javascript">
  
    var cboTeachers;
    var cboStudents;
  
    // Get id's of combo objects
    function pageLoad() {
        cboTeachers = $find("<%= cboTeachers.ClientID %>");
        cboStudents = $find("<%= cboStudents.ClientID %>");
    }
  
    // Set first item in a specified combo box
    function ItemsLoaded(combo, eventArgs) {
        if (combo.get_items().get_count() > 0) {
            // pre-select the first item
            combo.set_text(combo.get_items().getItem(0).get_text());
            combo.get_items().getItem(0).highlight();
        }
    }
  
    // Load Teachers
    function cboTeachers_Load(combo, eventArgs) {
        var item = eventArgs.get_item();
        cboTeachers.set_text(" ");
        cboTeachers.clearSelection();
        cboTeachers.requestItems(item.get_value(), false);
  
    }
  
    // Load Students
    function cboStudents_Load(combo, eventArgs) {
        var item = eventArgs.get_item();
        cboStudents.set_text(" ");
        cboStudents.clearSelection();
        cboStudents.requestItems(item.get_value(), false);
    }
  
  
    </script>
  
  
</form>


Default.aspx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Call cboContentAreas_Load()
    Call cboTeachers_Load(cboContentAreas.SelectedValue)
    Call cboStudents_Load(cboTeachers.SelectedValue)
End Sub
 
Protected Sub cboContentAreas_Load()
    'This would usually call a SQL connection, but for demo purposes, it's hardcoded
    Dim itemsList As New ArrayList()
    itemsList.Add("Language Arts")
    itemsList.Add("Mathematics")
    itemsList.Add("Science")
    cboContentAreas.DataSource = itemsList
    cboContentAreas.DataBind()
End Sub
 
Protected Sub cboTeachers_Load(ContentArea As String)
    'This would usually call a SQL connection, but for demo purposes, it's hardcoded
    Dim itemsList As New ArrayList()
    If ContentArea = "Language Arts" Then
        itemsList.Add("Austen, Jane")
        itemsList.Add("Dickens, Charles")
        itemsList.Add("Kipling, Rudyard")
    ElseIf ContentArea = "Mathematics" Then
        itemsList.Add("Euler, Leonhard")
        itemsList.Add("Fibonacci, Leonardo")
        itemsList.Add("Gauss, Carl")
    Else
        itemsList.Add("Curie, Marie")
        itemsList.Add("Heisenberg, Werner")
        itemsList.Add("Rutherford, Ernest")
    End If
    cboTeachers.DataSource = itemsList
    cboTeachers.DataBind()
End Sub
 
Protected Sub cboStudents_Load(TeacherName As String)
    'This would usually call a SQL connection, but for demo purposes, it's hardcoded
    Dim itemsList As New ArrayList()
    If TeacherName = "Austen, Jane" Then
        itemsList.Add("Alba, Anna")
        itemsList.Add("Armond, Artie")
        itemsList.Add("Avery, Augustus")
    ElseIf TeacherName = "Dickens, Charles" Then
        itemsList.Add("Darby, Derek")
        itemsList.Add("Devon, Denise")
        itemsList.Add("DiCicco, Dominic")
    ElseIf TeacherName = "Kipling, Rudyard" Then
        itemsList.Add("Keane, Karen")
        itemsList.Add("Kirby, Kirk")
        itemsList.Add("Kuval, Kiersten")
    ElseIf TeacherName = "Euler, Leonhard" Then
        itemsList.Add("Edwards, Ernie")
        itemsList.Add("Epps, Eunice")
        itemsList.Add("Everett, Evelyn")
    ElseIf TeacherName = "Fibonacci, Leonardo" Then
        itemsList.Add("Farley, Frank")
        itemsList.Add("Ferme, Frederico")
        itemsList.Add("Freitag, Fritz")
    ElseIf TeacherName = "Gauss, Carl" Then
        itemsList.Add("Garrison, Ginger")
        itemsList.Add("Gerwig, Greta")
        itemsList.Add("Goodwin, George")
    ElseIf TeacherName = "Curie, Marie" Then
        itemsList.Add("Carlson, Christina")
        itemsList.Add("Cerone, Cassandra")
        itemsList.Add("Cooper, Charlie")
    ElseIf TeacherName = "Heisenberg, Werner" Then
        itemsList.Add("Hartley, Hannah")
        itemsList.Add("Higgins, Hank")
        itemsList.Add("Hughes, Houston")
    Else
        itemsList.Add("Rand, Rita")
        itemsList.Add("Richmond, Robert")
        itemsList.Add("Rutherford, Rodney")
    End If
    cboStudents.DataSource = itemsList
    cboStudents.DataBind()
End Sub
 
Protected Sub cboContentAreas_ItemsRequested(sender As Object, e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles cboContentAreas.ItemsRequested
    cboContentAreas_Load()
End Sub
 
Protected Sub cboTeachers_ItemsRequested(sender As Object, e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles cboTeachers.ItemsRequested
    cboTeachers_Load(e.Text)
End Sub
 
Protected Sub cboStudents_ItemsRequested(sender As Object, e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles cboStudents.ItemsRequested
    cboStudents_Load(e.Text)
End Sub
Dimitar Terziev
Telerik team
 answered on 09 Aug 2011
5 answers
92 views

Please help

I use <div>'s in my asp form and i want the div visiblity to change when i click on the ribbonbartab

Rumen
Telerik team
 answered on 09 Aug 2011
3 answers
114 views
When the content inside a RadEditor in a form is more than one letter page long is not printing properly, creating one or more page breaks before printing the content. I guess it has to be with the IFrame. What can I do to print the content continuously as the rest of my form?

Thanks,
JD
Rumen
Telerik team
 answered on 09 Aug 2011
1 answer
36 views
Hi, everybody!
I have a web page and a RadFormDecorator. I saw example http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid but I want select data in web page and update data in RadFromDecorater by use dataset in webpage.aspx and use C#, not use UpdateCommand in HTML code. Thank you very much!

Marin Bratanov
Telerik team
 answered on 09 Aug 2011
3 answers
219 views
Hi,

When i choose any row of the radgrid then i getting error on the line.Right now i am using the Q2 2011. and i also true the
RadGrid1.ClientSettings.EnablePostBackOnRowClick = true; 

        protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
        {
            selectedReceiptIndex = Convert.ToInt32(RadGrid1.SelectedIndexes[0]);    //Here i am gettin below error    
        }



error is ---- 

Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index


please reply soon.

Pavlina
Telerik team
 answered on 09 Aug 2011
1 answer
119 views
Hi,

How should i find controls inside RadGrid OnItemCommand event??

protected void grdMessageState_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
           if (e.CommandName == RadGrid.InitInsertCommandName)
                {
                    SysXTextBox testName = e.Item.FindControl("txtStateName") as SysXTextBox;
                    testName.Focus();
                }
            }
        }

Thanks
Amit Choudhary
Princy
Top achievements
Rank 2
 answered on 09 Aug 2011
3 answers
166 views
I have a RadDateTimePicker that is hidden when the page is loaded but if the user selects a specific type of field to search against it then gets shown. When the control gets shown, the buttons for the date and time popups do not show. Weird thing is that if I put a seperate RadDateTimePicker control on the page they do show. This is a control that is hosted on a content page in case that would matter.

<telerik:RadDateTimePicker ID="SearchValueDate" runat="server" Calendar-ShowRowHeaders="false" Visible="false" TabIndex="4" >
</telerik:RadDateTimePicker>


if (ddlSearchCriteria.SelectedValue == FilterOperator.DateOnlyRange.ToString()
    || ddlSearchCriteria.SelectedValue == FilterOperator.DateTimeRange.ToString())
{
    lblStart.Text = GetString("CustomSearch.lblStart.StartDate.Text");
    lblEnd.Text = GetString("CustomSearch.lblEnd.EndDate.Text");
    lblStart.Visible = true;
    lblEnd.Visible = true;
    SearchValueDateEnd.Visible = true;
}

pretty straight forward stuff so I'm not sure where this is broken. Is there anything else I need to do to make this happen?

Don
Maria Ilieva
Telerik team
 answered on 09 Aug 2011
1 answer
155 views
Hi,

RadEditor strip font not working when content paste from pdf document.

I am using the RadEditor (version: 2011.1.315.40) with edit form as a model popup.

Below is code snippet that I used in my application

<telerik:RadEditor ID="RadEditor1" runat="server" SpellCheckSettings-DictionaryPath="../RadSpellControl/TDF/"
    EditModes="Design" BorderStyle="None" BorderWidth="0px" Height="129px" Width="250px"
        ContentAreaCssFile="~/css/radeditor.css" OnClientPasteHtml="OnClientPasteHtml"
        OnClientLoad="InitialDescriptionText">
        <Tools>
            <telerik:EditorToolGroup>
                    <telerik:EditorTool Name="Bold" />
                        <telerik:EditorTool Name="Italic" />
                        <telerik:EditorTool Name="Underline" />
                </telerik:EditorToolGroup>
                <telerik:EditorToolGroup>
                        <telerik:EditorTool Name="InsertOrderedList" Text="Ordered List" />
                </telerik:EditorToolGroup>
                <telerik:EditorToolGroup>
                          <telerik:EditorTool Name="PasteFromWordNoFontsNoSizes" />
                 </telerik:EditorToolGroup>
        </Tools>
</telerik:RadEditor>


I have a client application that allows them to enter comments into the RadEditor with Bold, Italic, Underline and numbering option only. so when any content pasted in

RadEditor is strip all style and css except Bold, Italic, Underline and numbering option. that's thing working properly in when content paste from ms-word document for

IE and Firefox browser.

But when content copied and paste from any pdf document then it works only for IE properly with help of "Paste from Word, strip font" button.

but in Firefox, it remove(striped) all style and css with Bold, Italic, Underline and numbering option with help of "Paste from Word, strip font" button..


Could you let me know what is reason of it is not working when the contents are copied from pdf document?


Awaiting for response.


Regards,

Nimesh 
Rumen
Telerik team
 answered on 09 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?