Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
107 views
Hi. I have been trying to figure out how to reorder the items listed in the chart legend, but so far to no avail. I'd like to do something along the lines of this:

                List<Telerik.Charting.ChartLabel> legendItems = new List<Telerik.Charting.ChartLabel>();

                legendItems.Add(RadChart1.Legend.Items[0]);
                legendItems.Add(RadChart1.Legend.Items[2]);
                legendItems.Add(RadChart1.Legend.Items[5]);
                legendItems.Add(RadChart1.Legend.Items[1]);
                legendItems.Add(RadChart1.Legend.Items[4]);
                legendItems.Add(RadChart1.Legend.Items[3]);
                legendItems.Add(RadChart1.Legend.Items[6]);

                for (int i = 0; i < 7; i ++)
                    RadChart1.Legend.Items[i] = legendItems[i];

But when I run this the RadChart1.Legend.Items appears empty. I am sure I am missing something here and was hoping you'd be able to lend a hand.

I would essentially like to know how I can reorder the labels that appear in the legend block.

Thank you!
Evgenia
Telerik team
 answered on 18 Mar 2011
6 answers
125 views
I am a newbie in using telerik controls so my question may be foolish but i am stuch here so i gotta ask.
i am trying to add appointments into the radscheduler on pageload.....
but i am getting this error
'Telerik.Web.UI.AppointmentCollection' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'Telerik.Web.UI.AppointmentCollection' could be found (are you missing a using directive or an assembly reference?)'
i have referenced Telerik.Web.UI in my page as well as the project....

the code snippet is as below
**dr is the object of SqlDataReader

Appointment ap = new Appointment();
 ap.Subject = dr["Subject"].ToString();
ap.Start = DateTime.Parse(dr["StartDateTime"].ToString());
ap.End = DateTime.Parse(dr[""].ToString());
ap.RecurrenceRule = dr["RecurrenceRule"].ToString();

 this.RadScheduler1.InsertAppointment(ap);   ///Error is on this line...

Thanks in advance

Regards,
Sher


Sher
Top achievements
Rank 2
 answered on 18 Mar 2011
1 answer
102 views
Hey everyone,

Our current asp.net web application we use to manage our documents just records the URL of where the file is located (in a database). Within a gridview control the users can click the link to view the document. The gridview also has another column that can store a comment pertaining to the file, also located in a database.

Is it possible to have a comment column within the FileExplorer control ? I imagine a database of some sort will still need to be used to hold the comment information.

Any ideas?
Dobromir
Telerik team
 answered on 18 Mar 2011
0 answers
22 views
telerik RadScheduler non working day not displaying shaded on calendar view In IE8. its show Firefox,chrome,safari but not displaying in Only IE8 please help me as soon as possible



santosh
Top achievements
Rank 2
 asked on 18 Mar 2011
4 answers
94 views
I am trying to use a RadTabStrip control with a Close button on every tab. The Close button is created using TabTemplates.

Everything works fine, with the exception of IE6, where even though I use the styles provided in the Telerik example for the IE6 to fix the line-height bug,  it still does not render properly. The bottom of the tabs is slightlly missaligned.  

I have included a screen shot of the problem (UISample.JPG). Also, bellow I listed the sample aspx code and the css I am using.

I have tried to play with the css style, but I did not manage to get it to work properly. Does anybody have a solution for this ?

Thanks a lot for the help !


This is the aspx code:

 

 

 

<head runat="server">   
<title>Untitled</title
<link rel="stylesheet" type="text/css" href="styles.css" /> 
</head>
<body>
<form id="mainForm" runat="server">
 <telerik:RadScriptManager runat=server ID="ScriptManager"></telerik:RadScriptManager
 <div
  <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0" Skin="Vista" ScrollChildren="true" ScrollButtonsPosition="Middle" Orientation="HorizontalTop"
  <TabTemplate
   <div class="textWrapper"
    <%# DataBinder.Eval(Container, "Text") %> 
   </div
   <span class="ie6shim"></span
   <img src="Images/Close.gif" alt="Close" onclick="deleteTab('<%# DataBinder.Eval(Container, "Text") %>')" /> 
  <TabTemplate
<Tabs
 <telerik:RadTab runat="server" Selected="True" Text="Tab1"></telerik:RadTab
 <telerik:RadTab runat="server" Text="Tab2"></telerik:RadTab
 <telerik:RadTab runat="server" Text="Tab3"></telerik:RadTab
</Tabs
</telerik:RadTabStrip
</div
</form
</body>
  
  
  
This is the styles.css file:
   
  
.tabStrip
 position:absolute; 
 top:0; 
}
  
.rtsIn img 
 vertical-align:middle; 
 width: 14px; 
 height: 14px; 
 margin-left: 10px; 
}
  
  
.rtsIn .textWrapper 
 display: inline; 
}
   
  
/* IE6 fixes for line-height bug */
  
* html .rtsIn img 
 margin-bottom: 10px; 
}
  
* html .rtsIn .textWrapper 
 float: left; 
 height:26px; 
}
  
* html .rtsIn .ie6shim 
 height: 26px; 
 display: inline-block; 
}

 

 

 

 

 

 

 

 

 

vivek
Top achievements
Rank 1
 answered on 18 Mar 2011
4 answers
126 views
Hi,
I want to restrict the user to enter maximum of 4 alphabets in subjects field, and i also want to control the display size of the subject field.
Can u please guide me how to perform these activities. Your quick response will be greatly appreciated.

Thanks & Regards,
Sher
Sher
Top achievements
Rank 2
 answered on 18 Mar 2011
1 answer
89 views
hey there,

i have a radgrid with CRUD operations.I've used automatic inserts an updates and used this event OnInsertCommand="RadGrid1_InsertCommand" and used advanced data binding with NeddDataSource event.But the problem is that on clicking insert or update after filling the required fields, my edit form is not closed and grid is not refreshed.When i press cancel than the grid is refreshed and the values that i've inserted or updated are than visible.What cud be the possible reason??...

Thanks
Amit
Princy
Top achievements
Rank 2
 answered on 18 Mar 2011
2 answers
218 views
I have a grid with a repeater with a checkboxlist inside.  I have no problem displaying the page, but when i try and get the value of the checkboxlist on the insert command in the code behind ... I cannot seem to get the values

here is an example of my code the only part that doesnt work is when i try an get the selected check boxes

Any ideas?

<asp:Repeater ID="rptMarkets" runat="server" DataSourceID="objMarkets">
    <ItemTemplate>
        <b>
            <%#DataBinder.Eval(Container.DataItem, "Market")%></b>
        <!-- Nested Repeater Level 2 - START -->
        <asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("MarketID") %>' />
        <asp:ObjectDataSource ID="objProducts" runat="server" SelectMethod="GetProductsByMarketsID"
            TypeName="Ceradyne.clsLibrary">
            <SelectParameters>
                <asp:ControlParameter Name="MarketID" Type="Int32" ControlID="HiddenField1" PropertyName="Value" />
            </SelectParameters>
        </asp:ObjectDataSource>
         
        <ul>
            <asp:CheckBoxList ID="clProductName" runat="server" DataSourceID="objProducts" DataTextField="ProductName" DataValueField="ProductID" RepeatColumns="3" Font-Size="8px">
            </asp:CheckBoxList>
        </ul>
        <!-- Nested Repeater Level 2 - END -->
    </ItemTemplate>
    <SeparatorTemplate>
        <hr />
    </SeparatorTemplate>
</asp:Repeater>
Protected Sub RadGrid1_InsertCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand
    'save the file to the website
    Dim txtPDFFile As String = ""
    Dim Upload As RadUpload = TryCast(e.Item.FindControl("upBrochurePDF"), RadUpload)
    Dim BrochureFolder As String = Server.MapPath("~/uploads/brochures/")
    If Upload.UploadedFiles.Count > 0 Then
        For Each file As UploadedFile In Upload.UploadedFiles
            txtPDFFile = file.GetName()
            file.SaveAs(BrochureFolder & txtPDFFile, True)
        Next
    End If
 
    'check to see if this file name exists already
    '(not written yet)
 
 
    ' save the file name to the database
    objBrochure.AddBrochure(txtPDFFile)
 
    'look up the brochure id based on the filename
    objBrochure.GetBrochuresByFilename(txtPDFFile)
    Dim BrochureID As Integer = objBrochure.BrochureID
 
    'save the value of the check boxes
    Dim ProductID As Integer
    Dim i As Integer
    Dim List As CheckBoxList = DirectCast(e.Item.FindControl("clProductName"), CheckBoxList)
    For i = 0 To List.Items.Count - 1
        If List.Items(i).Selected = "true" Then
            ProductID = List.Items(i).Value
            'add brochure links to products
            objBrochure.AddBrochureProductLink(BrochureID, ProductID)
        End If
    Next
 
    Response.Redirect("/admin/Library/ManageBrochures.aspx")
End Sub
Michael
Top achievements
Rank 1
 answered on 18 Mar 2011
2 answers
56 views
Hello,

I am using the client-side API and use AllowMultiRowSelection="True". I need to rebind a second control when a grid row is selected or deselected. My problem is that using the shift key or the checkbox at the top of the grid, many or all rows can be selected at once and each (correctly) fires the RowSelected event, causing many rebinds of the second control.

 

I only want to fire the rebind once per user action. Any suggestion is appreciated.

Marcel
Top achievements
Rank 1
 answered on 17 Mar 2011
2 answers
141 views
hi,
trying to set the date of raddatepicker on radnumerictextbox clientevents_onvaluechanged. but it is not working..

aspx:

<

 

telerik:GridTemplateColumn HeaderText="Months To Recall" UniqueName="MonthsCol" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">

 

 

<ItemTemplate>

 

 

<asp:Label ID = "MonthsTxt" runat = "server"></asp:Label>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<telerik:RadNumericTextBox ID = "MonthsEditTxt" runat = "server" ClientEvents-OnValueChanged = "MonthsTextChanged">

 

 

<NumberFormat DecimalDigits="0"/>

 

 

</telerik:RadNumericTextBox>

 

<%

--<telerik:RadTextBox ID = "MonthsEditTxt" runat = "server"></telerik:RadTextBox>--%>

 

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="NextRecallCol" HeaderStyle-HorizontalAlign="Center"

 

 

HeaderText="Next Recall" ItemStyle-HorizontalAlign="Center">

 

 

<ItemTemplate>

 

 

<asp:Label ID = "NextRecall" runat = "server" Width = "150px" Text = '<%#DataBinder.Eval(Container.DataItem, "RecallDate")%>'></asp:Label>

 

 

<%

-- <telerik:RadTextBox ID = "NextRecallbox" runat = "server" Text = '<%#DataBinder.Eval(Container.DataItem, "RecallDate")%>' Width = "160px"></telerik:RadTextBox>--%>

 

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<telerik:RadDatePicker ID="NextRecallEdit" runat="server" Width="140px" AutoPostBack="true" MinDate="2006/1/1"

 

 

DateInput-EmptyMessage="NextRecallDate" DbSelectedDate='<%# Bind("RecallDate") %>' Calendar-ClientEvents-OnDateSelected = "RecallDateChange">

 

 

 

</telerik:RadDatePicker>

 

<%

--<telerik:RadTextBox ID= "NextRecallEditBox" runat="server"></telerik:RadTextBox>--%>

 

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 



JAVASCRIPT:

 

<script type="text/javascript">

 

 

 

function MonthsTextChanged(sender, eventArgs)

 

 

{

 

<%

for(int index = 0; index < MonthLabelClientIDList.Count; index++)

 

 

{

 

string monthLblClientID = MonthLabelClientIDList[index];

 

string NextRecallClientID = NextRecllClientIDList[index];

 

 

 

%>

 

 

var months = $find("<%=monthLblClientID %>");

 

 

 

var nextrecall = $find("<%=NextRecallClientID %>");

 

 

 

var todaysDate = new Date();

 

 

 

var newdate = [months.get_value(),todaysDate.getDate(),todaysDate.getFullYear()];

 

 

 

 

nextrecall.set_selectedDate(newdate);

 

 

 

<% } %>

 

 

 

}


ASPX.CS

protected

 

IList<string> MonthLabelClientIDList

 

 

{

 

 

get

 

{

 

return (IList<string>)ViewState["MonthLabelClientIDList"];

 

 

}

 

 

set

 

{

ViewState[

"MonthLabelClientIDList"] = value;

 

 

}

 

}

 

 

protected IList<string> NextRecllClientIDList

 

 

{

 

 

get

 

{

 

return (IList<string>)ViewState["NextRecllClientIDList"];

 

 

}

 

 

set

 

{

ViewState[

"NextRecllClientIDList"] = value;

 

 

}

 

}


protected

 

void ItemDataBound(object sender, GridItemEventArgs e)

 

 

{

 

 

if (MonthLabelClientIDList == null)

 

 

{

 

MonthLabelClientIDList =

new List<string>();

 

 

NextRecllClientIDList =

new List<string>();

 

 

 

 

}

 

 

if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)

 

 

{

 

 

GridEditableItem editItem = e.Item as GridEditableItem;

 

 

RadNumericTextBox monthsToRecall = (RadNumericTextBox)e.Item.FindControl("MonthsEditTxt");

 

 

 

RadDatePicker nextRecall = (RadDatePicker)e.Item.FindControl("NextRecallEdit");

 

MonthLabelClientIDList.Add(monthsToRecall.ClientID);

NextRecllClientIDList.Add(nextRecall.ClientID);

}

Please guide me..

Chinna
Top achievements
Rank 1
 answered on 17 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?