Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
82 views
Hi,
    I have used the code of Telerik's Load on demand Combo box. I am trying to fecth the value of the SelectedItem,which I failed to fetch. Please see my code below and suggest me the solution.

[

WebMethod]

 

 

public static RadComboBoxData GetCompanyNames(RadComboBoxContext context)

 

{

 

DataSet data = GetData(context.Text);

 

 

RadComboBoxData comboData = new RadComboBoxData();

 

 

int itemOffset = context.NumberOfItems;

 

 

int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Tables[0].Rows.Count);

 

comboData.EndOfItems = endOffset == data.Tables[0].Rows.Count;

 

List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(endOffset - itemOffset);

 

 

for (int i = itemOffset; i < endOffset; i++)

 

{

 

RadComboBoxItemData itemData = new RadComboBoxItemData();

 

itemData.Text = data.Tables[0].Rows[i][

"ClientName"].ToString();

 

itemData.Value = data.Tables[0].Rows[i][

"ClientId"].ToString();

 

 

result.Add(itemData);

}

comboData.Message = GetStatusMessage(endOffset, data.Tables[0].Rows.Count);

comboData.Items = result.ToArray();

 

return comboData;

 

}

 

protected void rcbClientName_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)

 

{

 

DataSet data = GetData(e.Text);

 

 

int itemOffset = e.NumberOfItems;

 

 

int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Tables[0].Rows.Count);

 

e.EndOfItems = endOffset == data.Tables[0].Rows.Count;

 

    for (int i = itemOffset; i < endOffset; i++)

 

    {

 

        RadComboBoxItemData itemData = new RadComboBoxItemData();

 

        rcbClientName.Items.Add(

new RadComboBoxItem(data.Tables[0].Rows[i]["ClientName"].ToString(),

 

        data.Tables[0].Rows[i][

"ClientName"].ToString()));

 

 

 

 

    }

 

    e.Message = GetStatusMessage(endOffset, data.Tables[0].Rows.Count);

}

 

 

private static string GetStatusMessage(int offset, int total)

 

    {

 

        if (total <= 0)

 

 

            return "No Match";

 

 

            return String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total);

 

    }

 

private static DataSet GetData(string text)

 

    {

 

        return TaxForms.GetClientNameAndId(text);

 

    }

 

protected void btnSelectClient_Click(object sender, EventArgs e)

 

    {

        DisplaySelection(rcbClientName, txtClientId);

    }

 

private void DisplaySelection(RadComboBox name, TextBox text)

 

{

    txtClientId.Text = rcbClientName.SelectedValue;

}

 

Veselin Vasilev
Telerik team
 answered on 29 Oct 2009
1 answer
175 views
I've noticed that the RadTabStrip FindTabByUrl method does not find the tab if the session id exists in the page url. If the session is removed from the page url, the tab with the corresponding url is found and can then be selected. The session state mode I have is set to AutoDetect, so this would only happen if the user has cookies disabled, but I want the experience to be the same regardless.

Is this bug with RadTabStrip or is their a way for me to avoid this situation from occurring, other than using cookie-only sessions, which is something I don't want to do.

Thanks
T. Tsonev
Telerik team
 answered on 29 Oct 2009
1 answer
135 views
Hi,

I would like to use the RadUpload control to allow inserting of a file into a SharePoint document library from a grid.  Has anyone managed to acheive this?  I don't see a way to override save to grab the stream and push it into my library.

Thoughts or advice appreciated.

Craig
Veselin Vasilev
Telerik team
 answered on 29 Oct 2009
1 answer
192 views
Hi All,

I have a grid that has 4 columns, the first one is a bound column and the rest are radio button columns.
I am creating the grid programatically.
1) The problem I am facing is on how to create the 3 radio button columns, I think its possible to do this in declartivley in the aspx page, but I want a way that I could add this columns to the grid programmatically.

2) and also I followed this link http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html, hear I see that I would have to creat the "MyTemplate " class to use a template, is there a dafult class in RAD that could handle this for me, I mean when I create a template column declartively I dont specfiy a concrete class that implements ITemplate.


Would be great If I can hear back from you guys.

Regards,
Nairooz
Yavor
Telerik team
 answered on 29 Oct 2009
4 answers
193 views
I have a RadDockLayout where I have a DockZone. Inside this DockZone I add a Dock - so far, so good - now I want to add a new DockZone to the Dock and thus allow nested Docks. All of this happens programmatically from code behind.

So far I haven't succeeded. How is this done? Where do I add the new DockZone to the Dock? Do I add it to the Controls-collection or somehow to the ContentTemplate? Please illustrate with an example.

Thanks!
Pero
Telerik team
 answered on 29 Oct 2009
1 answer
105 views
Hello,

I have 3 series that i would like to plot.  The first two, I would like to do a stacked-bar type plot, while leaving the last one in its own bar (plotted on the secondary y-axis).  I've been able to do this pretty easily by assigning the chart types to the series, but I have one problem which I cannot get around.  I would like the stacked bar to be on the left, and the normal bar to be on the right.  So far, no matter what I do, the stacked bar is always on the right of the normal bar.

I've attached a sample image.  The image shows how close I've come.  I want the green-red stacked bar to be on the left of the blue bar.

Does anyone know how to specify the order in which different chart types are rendered?

Thanks in advance,

Dan
Giuseppe
Telerik team
 answered on 29 Oct 2009
2 answers
252 views
Hi!

I want to set both the NavigateUrl and the Icon from code - client script or otherwise - but so far I've only found the setUrl method for RadWindow. How can I change the Icon for the RadWindow?
Christoffer Rosenqvist
Top achievements
Rank 1
 answered on 29 Oct 2009
2 answers
80 views
Hi,

I've got a grid that I am setting up so that ALL rows are editable.  I'm using the second method in the http://www.telerik.com/help/aspnet-ajax/grddefaulteditmodeforgriditemsoninitialload.html example.  This method specifies that you need to set the EditMode of the grid to EditForms.  I've done that and it works however I need the grid to now hide the non-editable rows.  At the moments its:
Row 1 data
Row 1 Edit form
Row 2 data
Row 2 Edit form

I want to get rid of the data row.  Any ideas. 

Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 29 Oct 2009
1 answer
188 views
I have a RadComboBox that is populated in the code-behind. I am attaching a tool tip to each item in the combo box. Each tool tip displays on the page load but once the page is postback (there are other controls on the page that have AutoPostBack=True), the tool tips no longer display.

'in aspx page

<telerik:RadComboBox ID="RadComboPriority" runat="server" Width="280px" TabIndex="7" CssClass="blackText9" AllowCustomText="false"></telerik:RadComboBox>
  

'populating the RadComboBox on PageLoad

Public Sub LoadPriorities()
        Dim description As String
        Dim item As New RadComboBoxItem()
        item.Text = ""
        item.Value = 0
        RadComboPriority.Items.Add(item)

        Dim item1 As New RadComboBoxItem()
        item1.Text = "1 - Immediate"
        item1.Value = 1
        description = "Use this code when you are not able to do your job."
        ToolTipify(item1, description)
        RadComboPriority.Items.Add(item1)

        Dim item2 As New RadComboBoxItem()
        item2.Text = "2 - Serious"
        item2.Value = 2
        description = "For when you are able to do your job, but you are limited by a problem."
        ToolTipify(item2, description)
        RadComboPriority.Items.Add(item2)

        Dim item3 As New RadComboBoxItem()
        item3.Text = "3 - Minor"
        item3.Value = 3
        description = "This code is used when you need help but can wait until the priority 1 and 2 work orders are handled first."
        ToolTipify(item3, description)
        RadComboPriority.Items.Add(item3)
    End Sub

 

 

 

 

'adding tool tip to each item
Public Sub ToolTipify(ByVal item As RadComboBoxItem, ByVal description As String)
        Dim tip As New RadToolTip()
        item.Attributes.Add("ID", Guid.NewGuid().ToString())
        tip.RelativeTo = ToolTipRelativeDisplay.Element
        tip.Text = description
        tip.TargetControlID = item.Attributes("ID")
        tip.IsClientID = True
        'tip.ShowEvent = ToolTipShowEvent.FromCode
        'form1.Controls.Add(tip)
        tip.VisibleOnPageLoad = True
        tip.HideEvent = ToolTipHideEvent.LeaveToolTip
        Me.Page.Form.Controls.Add(tip)
    End Sub

 

I am unable to get the tool tips to display after the page has been posted back. Any help would be appreciated.
Thanks,
Cindy

 

 

 

 

 

 

 

 

 

 

 

 

 

Svetlina Anati
Telerik team
 answered on 29 Oct 2009
1 answer
80 views
Hello,

Can i get this Telerik example in a .sln .zip download from anywhere?

I've tried to piece it together the code from the online screens using VS2009 but am having problems getting it to compile because i'm not sure how to load the COMMON files below:

http://demos.telerik.com/aspnet-classic/treeview/Examples/Functionality/CheckBoxes/DefaultCS.aspx    

<%

@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>

 

<%

@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>

 

<%

@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>

I also downloaded the Telerik Samples that come with the documentation and didn't find this example in samplels, but basically, i'm looking for TreeView - Checkbox example/s

Thanks very much for any pointers

 

Paul
Telerik team
 answered on 29 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?