Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
134 views
I have a horizantal tabstrip with two tabs linked to a multi page, each multi page include a virtecal tabstrip linked to a multipage,
what I need is when user select a tab from the horizantal tabstrip only linked multipage to the tabstrip in the linked page view to be dispayed.

I wrote the following code but it keep hiding the first multipage only:

<

 

script>

 

 

function OnClientTabSelected(sender, eventArgs) {

 

 

var multiPage2 = $find("<%=RadMultiPage2.ClientID %>");

 

 

var multiPage3 = $find("<%=RadMultiPage3.ClientID %>");

 

 

var tab = eventArgs.get_tab();

 

 

var text = tab.get_text();

 

 

if (text = "Daily Profile") {

 

multiPage3.set_visible(

false);

 

multiPage2.set_visible(

true);

 

}

 

else {

 

multiPage3.set_visible(

true);

 

multiPage2.set_visible(

false);

 

}

}

</

 

script>

 

<

 

table cellpadding="0" cellspacing="0" width="970px">

 

 

<tr>

 

 

<td width="150">

 

 

&nbsp;

 

 

</td>

 

 

<td width="820">

 

 

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0" Skin="Windows7"

 

 

MultiPageID="RadMultiPage1" OnClientTabSelected="OnClientTabSelected">

 

 

<Tabs>

 

 

<telerik:RadTab runat="server" Text="Daily Profile" Width="410px">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="Immediate Profile" Width="410px">

 

 

</telerik:RadTab>

 

 

</Tabs>

 

 

</telerik:RadTabStrip>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">

 

 

<telerik:RadPageView ID="RadPageView1" runat="server" Selected="True">

 

 

<telerik:RadTabStrip ID="RadTabStrip2" runat="server" Orientation="VerticalLeft"

 

 

SelectedIndex="0" Skin="Windows7" Width="150px" MultiPageID="RadMultiPage2">

 

 

<Tabs>

 

 

<telerik:RadTab runat="server" Text="tab 1">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="tab 2">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="tab 3">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="tab 4">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="tab 5">

 

 

</telerik:RadTab>

 

 

</Tabs>

 

 

</telerik:RadTabStrip>

 

Daily

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView2" runat="server">

 

 

<telerik:RadTabStrip ID="RadTabStrip3" runat="server" Orientation="VerticalLeft"

 

 

SelectedIndex="0" Skin="Windows7" Width="150px" MultiPageID="RadMultiPage3">

 

 

<Tabs>

 

 

<telerik:RadTab runat="server" Selected="True" Text="tab 6">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="tab 7">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="tab 8">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="tab 9">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="tab 10">

 

 

</telerik:RadTab>

 

 

</Tabs>

 

 

</telerik:RadTabStrip>

 

Immediate

 

</telerik:RadPageView>

 

 

</telerik:RadMultiPage>

 

 

</td>

 

 

<td>

 

 

<telerik:RadMultiPage ID="RadMultiPage2" runat="server">

 

 

<telerik:RadPageView ID="RadPageView3" runat="server" Selected="true">

 

1

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView4" runat="server">

 

2

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView5" runat="server">

 

3

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView6" runat="server">

 

4

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView7" runat="server">

 

5

 

</telerik:RadPageView>

 

 

</telerik:RadMultiPage>

 

 

<telerik:RadMultiPage ID="RadMultiPage3" runat="server">

 

 

<telerik:RadPageView ID="RadPageView8" runat="server" Selected="true">

 

6

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView9" runat="server">

 

7

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView10" runat="server">

 

8

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView11" runat="server">

 

9

 

</telerik:RadPageView>

 

 

<telerik:RadPageView ID="RadPageView12" runat="server">

 

10

 

</telerik:RadPageView>

 

 

</telerik:RadMultiPage>

 

 

</td>

 

 

</tr>

 

</

 

table>

one thing more, I need to hide multipage3 on page load.

Thank you in advanced

 

Saeid Kdaimati
Top achievements
Rank 2
 answered on 11 Nov 2010
1 answer
97 views
I have a grid with column 'Balance' on which aggregate function is set as sum.
The result to be shown on the footer.

Its working fine in normal case.
But after grouping a particular field the value is shown as zero on the footer.

Can anyone help me??
Vasil
Telerik team
 answered on 11 Nov 2010
5 answers
227 views
Hello,
Newbie here...  Using AJAX RadControls with VS 2010.

I want to display a "Data Saved" info message box from the server side when a "Save" button is pressed.

I did this by adding the appropriate javascript to display a RadAlert in the onload() event for the page.
The good news is that the message does show up in the RadAlert in the onload. But.... the
problem is that if the user navigates away from the page & then returns ( via the Back button),
the onload() fires again and the RadAlert is displayed.

This isn't a Telerik problem, but thought you may have come across this problem before.
Any recommendations as to how this RadAlert will only be shown once
( displayed when user press button but NOT on Browser BACK).

here is my code snippet below.

Thank in advance,
bruce

-----------------------------------------------------------------
            string message = "Data saved";
            string script1 = "<script language='javascript'> window.onload = function(){radalert('";
      string script2 = "', 300, 120);}</script>";
      string script = script1 + message + script2;

            ClientScriptManager cs = p.ClientScript;
            String csname1 = "PopupScript";
            Type cstype = p.GetType();

            cs.RegisterStartupScript(cstype, csname1, script);
Georgi Tunev
Telerik team
 answered on 11 Nov 2010
3 answers
185 views
We are an E.S.P. (Email Service Provider) and user the Editor in a web application where the clients can design their newsletters themselves before sending. So our potential rendering platforms also include email clients i.e. Outlook etc...
The following text comes from an un-named tech doc.
"The Float: right property does not render correctly in Outlook 2007 because Outlook 2007 uses the Word 2007 HTML parsing and rendering engine to display HTML emails. Float and position are just two of several CSS properties that the Word 2007 engine considers 'unknown properties."
Our Problem:
When a user tries to insert an image into a message and chooses align right. The editor inserts a style element into the image tag. "style= FLOAT: right;"
 
This also happens when a user copies an older message and tries to replace the image and align it.
As a matter of fact the editor will add "style= FLOAT: right;" just by selecting the image and clicking on the Alignment drop down box and choosing Right.
Original HTML Code:
<IMG style="WIDTH: 240px; HEIGHT: 180px" border=0 hspace=15 alt="" vspace=12 align=right src="http://pages.nxtbook.com/nxtbooks/newbay/dv0610/assets/icon.gif" complete="complete">

HTML code after aligning right:
<IMG style="BORDER-BOTTOM: 0px solid; BORDER-LEFT: 0px solid; FLOAT: right; BORDER-TOP: 0px solid; BORDER-RIGHT: 0px solid" hspace=15 vspace=12 src="http://pages.nxtbook.com/nxtbooks/newbay/dv0610/assets/icon.gif" complete="complete">

Is their a way to prevent the edit image dialog box from turning the align right dropdown into the float style tag?

Sincerely,

Dana Cobb
Dobromir
Telerik team
 answered on 11 Nov 2010
3 answers
191 views
I am developing a custom control and am trying to use RadStylesheetManager to embed the stylesheets in the assembly. This is what I have done so far:

1. developed the custom control which registers the stylesheet to the stylesheetmanager in OnPreRender of the control like this

RadStyleSheetManager.GetCurrent(Page).StyleSheets.Add(
   new StyleSheetReference("customstylesheet.css",
   System.Reflection.Assembly.GetAssembly(this.GetType()).FullName));

2. added the stylesheet to the assembly

[assembly: WebResource("MyCustomControl.customstylesheet.css", "text/css")]

3. set the build action to Embedded Resource

As far as I know that and should be all I need to do and so far everything seems to be looking fine and is working fine and dandy when I use the control in a web project. The resources are nicely retrieved via the WebResource.axd handler. The problem tough is that it ONLY works when I add my control design time. When I add the controls at runtime (in the page's init cycle), then the WebResource.axd handler reports a http error 500, specifically (curtosy of fiddler):

<html>
    <head>
        <title>String cannot have zero length.</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>
 
    <body bgcolor="white">
 
            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
 
            <h2> <i>String cannot have zero length.</i> </h2></span>
 
            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
 
            <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
            <br><br>
 
            <b> Exception Details: </b>System.ArgumentException: String cannot have zero length.<br><br>
 
            <b>Source Error:</b> <br><br>
 
            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code>
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
 
                  </td>
               </tr>
            </table>
 
            <br>
 
            <b>Stack Trace:</b> <br><br>
 
            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>
 
[ArgumentException: String cannot have zero length.]
   System.Reflection.RuntimeAssembly.GetManifestResourceInfo(RuntimeAssembly assembly, String resourceName, ObjectHandleOnStack assemblyRef, StringHandleOnStack retFileName, StackCrawlMarkHandle stackMark) +0
   System.Reflection.RuntimeAssembly.GetManifestResourceInfo(String resourceName) +79
   Telerik.Web.UI.ScriptAssemblyInfo.get_AssemblyType() +64
   Telerik.Web.UI.<>c__DisplayClass2.<WriteScripts>b__0(Match match) +21
   System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) +198
   System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator, Int32 count, Int32 startat) +33
   System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator) +38
   Telerik.Web.UI.CombinedScriptWriter.WriteScripts(List`1 scriptEntries, TextWriter outputWriter) +265
   Telerik.Web.UI.CombinedScriptWriter.WriteCombinedScriptFile() +1070
   Telerik.Web.UI.WebResource.ProcessRequest(HttpContext context) +74
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
</pre></code>
 
                  </td>
               </tr>
            </table>
 
            <br>
 
            <hr width=100% size=1 color=silver>
 
            <b>Version Information:</b> Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
 
            </font>
 
    </body>
</html>
<!--
[ArgumentException]: String cannot have zero length.
   at System.Reflection.RuntimeAssembly.GetManifestResourceInfo(RuntimeAssembly assembly, String resourceName, ObjectHandleOnStack assemblyRef, StringHandleOnStack retFileName, StackCrawlMarkHandle stackMark)
   at System.Reflection.RuntimeAssembly.GetManifestResourceInfo(String resourceName)
   at Telerik.Web.UI.CombinedScriptWriter.ScriptAssemblyInfo.get_AssemblyType()
   at Telerik.Web.UI.CombinedScriptWriter.<>c__DisplayClass2.<WriteScripts>b__0(Match match)
   at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
   at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator, Int32 count, Int32 startat)
   at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
   at Telerik.Web.UI.CombinedScriptWriter.WriteScripts(List`1 scriptEntries, TextWriter outputWriter)
   at Telerik.Web.UI.CombinedScriptWriter.WriteCombinedScriptFile()
   at Telerik.Web.UI.WebResource.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->

I have been banging into this for a couple of days now but can't seem to find the solution, so help is really appreciated. For the record, I have stepped throught the code and in the OnPreRender of my custom control the stylesheet reference looks to be added to the stylesheetmanager's stylesheet collection succesfully. A WebResource.axd link is generated indeed, so the manager 'thinks'  that something is registered indeed. But when retrieving the content of the resource it doesnt seem to find what it should be retrieving. 
/*                    RadStyleSheetManager styleSheetManager = RadStyleSheetManager.GetCurrent(Page);
                    if (styleSheetManager == null) throw new HttpException("A styleSheetManager control must exist on the current page.");
                    styleSheetManager.StyleSheets.Add(
                        new StyleSheetReference("Inception.Web.RibbonBar.Skins." + this.SkinID + ".RibbonTabStrip.css",
                                                System.Reflection.Assembly.GetAssembly(this.GetType()).FullName)); *
Simon
Telerik team
 answered on 11 Nov 2010
2 answers
226 views
Hi!

In my page i want to check one condition and want to give one rad alert on page load.

on buttons click it works but on page load it does not.

How can i give rad alert on page load?

thanks in advance.
geetha priya
Top achievements
Rank 1
 answered on 11 Nov 2010
2 answers
104 views
Is it possible to show a list of paragraph styles rather than only font.

Or is that not possible in the Lite edition?

Thanks in advance.
Stanimir
Telerik team
 answered on 11 Nov 2010
3 answers
173 views
I'm trying to achieve a drag from a RadTreeNode(basically a task) to a RadSchedulerTimeSlot (hence creating an appointment for that task). Now the problem is that NodeDrop is not firing when I drag the TreeNode to the RadScheduler.

Here's what I have:-

RadTreeView:
<telerik:RadTreeView ID="radTreeView" runat="server" CssClass="treeView" EnableDragAndDrop="True"
    OnClientNodeDropping="rowDropping" OnNodeDrop="radTreeView_NodeDrop" Skin="Windows7">
    <Nodes>
        <telerik:RadTreeNode runat="server" Owner="radTreeView" Text="Test">
            <Nodes>
                <telerik:RadTreeNode runat="server" Owner="" Text="Test2">
                </telerik:RadTreeNode>
                <telerik:RadTreeNode runat="server" Owner="" Text="Test">
                </telerik:RadTreeNode>
            </Nodes>
        </telerik:RadTreeNode>
        <telerik:RadTreeNode runat="server" Owner="radTreeView" Text="Test2">
        </telerik:RadTreeNode>
    </Nodes>
</telerik:RadTreeView>

RadScheduler:
<telerik:RadScheduler ID="radScheduler" runat="server" DayEndTime="19:00:00" FirstDayOfWeek="Monday"
    LastDayOfWeek="Sunday" OverflowBehavior="Expand" SelectedView="WeekView" ShowAllDayRow="False"
    ShowFooter="False" Skin="Windows7" WorkDayEndTime="19:00:00" OnClientAppointmentClick="OnClientAppointmentClick"
    OnClientTimeSlotClick="OnClientTimeSlotClick" CssClass="scheduler" ShowViewTabs="False">
    <AdvancedForm Modal="True" />
    <TimelineView UserSelectable="False" />
    <MonthView UserSelectable="False" />
</telerik:RadScheduler>

rowDropping Javascript:
function rowDropping(sender, eventArgs) {
    // Fired when the user drops a grid row
    var htmlElement = eventArgs.get_htmlElement();
    var scheduler = $find('<%= radScheduler.ClientID %>');
 
    if (isPartOfSchedulerAppointmentArea(htmlElement)) {
        // The row was dropped over the scheduler appointment area
        // Find the exact time slot and save its unique index in the hidden field
        var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
 
        // $get("TargetSlotHiddenField").value = timeSlot.get_index();
        $get('<%= TargetSlotHiddenField.ClientID %>').value = timeSlot.get_index();
 
        // The HTML needs to be set in order for the postback to execute normally
        eventArgs.set_htmlElement('<%= TargetSlotHiddenField.ClientID %>');
    }
    else {
        // The node was dropped elsewhere on the document
        eventArgs.set_cancel(true);
    }
}

HiddenTextbox:
<input type="hidden" runat="server" id="TargetSlotHiddenField" />

CodeBehind:
protected void radTreeView_NodeDrop(object sender, RadTreeNodeDragDropEventArgs e)
{
    RadTreeNode treeNode = e.DraggedNodes[0];
 
    string id = treeNode.Value;
    string subject = treeNode.Text;
    string targetSlotIndex = TargetSlotHiddenField.Value;
 
    if (targetSlotIndex != string.Empty)
    {
        HandleSchedulerDrop(id, subject, targetSlotIndex);
        TargetSlotHiddenField.Value = string.Empty;
    }
}
 
private void HandleSchedulerDrop(string id, string subject, string targetSlotIndex)
{
    radScheduler.Rebind();
 
    ISchedulerTimeSlot slot = radScheduler.GetTimeSlotFromIndex(targetSlotIndex);
 
    TimeSpan duration = TimeSpan.FromHours(1);
    if (slot.Duration == TimeSpan.FromDays(1))
    {
        duration = slot.Duration;
    }
 
    ScheduleTask(id, subject, slot.Start, slot.Start.Add(duration));
}


Most of it is stripped from your demos. If you need the rest of the code I'd be happy to supply the whole page and codebehind.

Thanks in advance.
Daryl
Nikolay Tsenkov
Telerik team
 answered on 11 Nov 2010
3 answers
216 views
Hi,

I have an issue where I need to RadGrid_ItemCommand from a seperate public method which in turn will be called by a different control.
Does anyone have any example of how this can be done?
Princy
Top achievements
Rank 2
 answered on 11 Nov 2010
1 answer
119 views
Hi,
     I'm create a HelpDesk project.In this i'm show all the ticket's according to status(Pending/Resolved).In one column im show ticket subject and Ticket Detail.when i'm click on any column for sorting then my gridview not show any data.but again when click on button then that is show the sorted data.It's also happens in paging.

       so please any one tell the way that i'm able to sort the ticket and also paging is work.I'm attached code please find...


using

 

System;

 

using

 

System.Collections;

 

using

 

System.Collections.Generic;

 

using

 

System.Linq;

 

using

 

System.Web;

 

using

 

System.Web.UI;

 

using

 

System.Web.UI.WebControls;

 

using

 

DotNetNuke.Entities.Modules;

 

using

 

DotNetNuke.Entities.Modules.Definitions;

 

using

 

DotNetNuke.Entities.Users;

 

using

 

DotNetNuke.Security.Permissions;

 

using

 

Mandeeps.HelpDesk.Base.Library.Data;

 

using

 

Telerik.Web.UI;

 

namespace

 

Mandeeps.DNN.Modules.HelpDesk

 

{

 

public partial class DnnHelpDesk : PortalModuleBase

 

{

Mandeeps.HelpDesk.Base.Library.

HelpDesk lhd;

 

 

ModuleSecurity ms;

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

ms =

new ModuleSecurity(this.ModuleConfiguration);

 

InitModulePermissions();

 

Mandeeps.DNN.Modules.HelpDesk.Data.

HelpdeskSettingDataContext context = new Modules.HelpDesk.Data.HelpdeskSettingDataContext(DotNetNuke.Common.Utilities.Config.GetConnectionString());

 

 

 

foreach (Mandeeps.DNN.Modules.HelpDesk.Data.HelpdeskSetting h in context.HelpdeskSettings)

 

{

lhd =

new Mandeeps.HelpDesk.Base.Library.HelpDesk(DotNetNuke.Common.Utilities.Config.GetConnectionString());

 

lhd.Pop3 =

new Mandeeps.HelpDesk.Base.Library.Mail.Pop3(h.Pop3LicenseKey, h.Pop3Server, h.Pop3Username, h.Pop3Password);

 

lhd.Smtp =

new Mandeeps.HelpDesk.Base.Library.Mail.Smtp(h.SmtpLicenseKey, h.SmtpServer, h.SmtpUsername, h.SmtpPassword);

 

lhd.Smtp.ServerPort = 2525;

lhd.PortalId = PortalId;

}

 

if(!IsPostBack)

 

Initilize();

}

 

public void Initilize()

 

{

 

List<Ticket> tic=null;

 

 

if(ms.IsOperator)

 

{

rtbSetting.Visible =

false;

 

rtbView.Items[0].Text =

"UnAssigned Tickets";

 

rtbView.Items[0].ToolTip =

"Click here for show UnAssigned Ticket's";

 

rtbView.Items[2].Text =

"My Tickets";

 

rtbView.Items[2].ToolTip =

"Click here for show Self Assigned Ticket's";

 

rtbView.Items[3].Visible =

true;

 

rtbView.Items[4].Visible =

true;

 

rgTicket.Columns[3].Visible =

true;

 

tic = lhd.GetAllOpenTickets(

null, UserId);

 

 

if (tic.Count == 0)

 

{

tic = lhd.GetAllUnassignedTickets();

((rtbView.Items[0])

as RadToolBarButton).Checked = true;

 

}

 

else

 

((rtbView.Items[2])

as RadToolBarButton).Checked = true;

 

}

 

else

 

tic = lhd.GetAllOpenTickets(UserId);

 

rgTicket.DataSource = tic;

rgTicket.DataBind();

}

 

protected void rtbSetting_ButtonClick(object sender, RadToolBarEventArgs e)

 

{

 

if (e.Item.Text == "Add New Ticket")

 

Response.Redirect(EditUrl(

"AddNewTicket"));

 

}

 

protected void rtbView_ButtonClick(object sender, RadToolBarEventArgs e)

 

{

 

List<Ticket> ticket = new List<Ticket>();

 

 

switch (e.Item.Text)

 

{

 

case "Pending":

 

{

rgTicket.Columns[6].Visible =

false;

 

ticket = lhd.GetAllOpenTickets(UserId);

 

break;

 

}

 

case "Resolved":

 

{

rgTicket.Columns[6].Visible =

true;

 

ticket = lhd.GetAllCloseTickets(UserId);

 

break;

 

}

 

case "UnAssigned Tickets":

 

{

rgTicket.Columns[4].Visible =

false;

 

rgTicket.Columns[6].Visible =

false;

 

ticket = lhd.GetAllUnassignedTickets();

 

break;

 

}

 

case "My Tickets":

 

{

rgTicket.Columns[4].Visible =

false;

 

rgTicket.Columns[6].Visible =

false;

 

ticket = lhd.GetAllOpenTickets(

null,UserId);

 

 

break;

 

}

 

case "All Tickets":

 

{

rgTicket.Columns[4].Visible =

true;

 

rgTicket.Columns[6].Visible =

false;

 

ticket = lhd.GetAllOpenTickets();

 

break;

 

}

}

 

rgTicket.DataSource = ticket;

rgTicket.DataBind();

}

 

protected void rgTicket_ItemDataBound(object sender, GridItemEventArgs e)

 

{

 

if (e.Item is GridDataItem)

 

{

 

GridDataItem item = e.Item as GridDataItem;

 

 

TableCell title = item["Title"];

 

 

if (title != null)

 

{

 

Control ctl = title.FindControl("hlTicketDetails");

 

 

if (ctl != null)

 

{

 

HyperLink ticketDetails = ctl as HyperLink;

 

 

Label ticketId = title.FindControl("lTicketDetails") as Label;

 

Mandeeps.HelpDesk.Base.Library.Data.

Ticket t = item.DataItem as Mandeeps.HelpDesk.Base.Library.Data.Ticket;

 

ticketId.Text =

"#" + t.TicketID.ToString();

 

 

if (t.Title.Length > 25)

 

ticketDetails.Text = t.Title.Substring(0, 25)+

"...";

 

 

else

 

ticketDetails.Text = t.Title;

ticketDetails.NavigateUrl = EditUrl(

"", "", "ViewTicketDetail", "TicketID=" + t.TicketID.ToString());

 

}

}

}

}

 

public string ConcatColumns(object objText)

 

{

 

if (objText.ToString().Length > 50)

 

 

return objText.ToString().Substring(0, 50)+ "...";

 

 

 

else

 

 

return objText.ToString();

 

}

 

public string CategoryName(object objText)

 

{

 

if (int.Parse(objText.ToString()) == 0)

 

 

return "";

 

 

else

 

 

return lhd.GetCategoryName(int.Parse(objText.ToString()));

 

}

 

public string AssignedToName(object objText)

 

{

 

if (int.Parse(objText.ToString()) == -1)

 

 

return "";

 

 

else

 

{

 

UserController uC = new UserController();

 

 

UserInfo user = uC.GetUser(PortalId, int.Parse(objText.ToString()));

 

 

return user.DisplayName;

 

}

}

 

}

 

protected void rgTicket_SortCommand(object sender, GridSortCommandEventArgs e)

 

{

}

}

}















<%

@ Control Language="C#" AutoEventWireup="true" CodeBehind="DnnHelpDesk.ascx.cs" Inherits="Mandeeps.DNN.Modules.HelpDesk.DnnHelpDesk" %>

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

 

<

 

telerik:RadToolBar ID="rtbSetting" runat="server" onbuttonclick="rtbSetting_ButtonClick" style="float:left">

 

 

<Items>

 

 

<telerik:RadToolBarButton runat="server" Text="Add New Ticket" ToolTip="Click here for Add New Ticket"/>

 

 

</Items>

 

</

 

telerik:RadToolBar>

 

<

 

telerik:RadToolBar ID="rtbView" runat="server" onbuttonclick="rtbView_ButtonClick" EnableShadows="True" style="float:right">

 

 

<Items>

 

 

<telerik:RadToolBarButton runat="server" Text="Pending" ToolTip="Click here for show Pending Ticket's" CheckOnClick="true" AllowSelfUnCheck="true" />

 

 

<telerik:RadToolBarButton runat="server" Text="Button 2" IsSeparator="True"/>

 

 

<telerik:RadToolBarButton runat="server" Text="Resolved" ToolTip="Click here for show Resolved Ticket's" CheckOnClick="true" AllowSelfUnCheck="true"/>

 

 

<telerik:RadToolBarButton runat="server" Text="Button 3" IsSeparator="True" Visible="false"/>

 

 

<telerik:RadToolBarButton runat="server" Text="All Tickets" ToolTip="Click here for show All Ticket's" Visible="false" CheckOnClick="true" AllowSelfUnCheck="true"/>

 

 

</Items>

 

</

 

telerik:RadToolBar><br style="clear:both;"/>

 

 

<

 

telerik:RadGrid ID="rgTicket" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" GridLines="None"

 

 

PageSize="4" onitemdatabound="rgTicket_ItemDataBound" Skin="Outlook" onsortcommand="rgTicket_SortCommand">

 

 

 

<MasterTableView>

 

 

<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px"/>

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px"/>

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="TicketID" HeaderText="TicketID" SortExpression="TicketID" UniqueName="TicketID" Visible="False"/>

 

 

 

<telerik:GridTemplateColumn HeaderText="Ticket Detail" UniqueName="Title">

 

 

<ItemTemplate>

 

 

<asp:HyperLink ID="hlTicketDetails" runat="server" Text="Subject Appears Here" Font-Size="Small" ForeColor="#0000ff"/>

 

 

<asp:Label ID="lTicketDetails" runat="server" Font-Size="Smaller" style="float:right"/><br/>

 

 

<div>

 

 

<asp:Label id="Label1" runat="server" Text='<%#ConcatColumns(DataBinder.Eval(Container.DataItem,"Description")) %>' ForeColor="#6699ff"/></div>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="Category" UniqueName="Title">

 

 

<ItemTemplate>

 

 

<asp:Label id="lcategory" runat="server" Text='<%#CategoryName(DataBinder.Eval(Container.DataItem,"CategoryId")) %>'/>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="Email" HeaderText="From" SortExpression="Email" UniqueName="Email" Visible="false"/>

 

 

<telerik:GridTemplateColumn HeaderText="Assigned To" UniqueName="Title" Visible="false">

 

 

<ItemTemplate>

 

 

<asp:Label id="lAssignedTo" runat="server" Text='<%#AssignedToName(DataBinder.Eval(Container.DataItem,"AssignedTo")) %>'/>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="OpenDateTime" HeaderText="Created On" SortExpression="OpenDateTime" UniqueName="OpenDateTime"/>

 

 

<telerik:GridBoundColumn DataField="CloseDateTime" HeaderText="Date Close" SortExpression="CloseDateTime" UniqueName="CloseDateTime" Visible="false"/>

 

 

</Columns>

 

 

</MasterTableView>

 

</

 

telerik:RadGrid>

 

Radoslav
Telerik team
 answered on 11 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?