Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
80 views
Hi,
  Here is the situation:
   I have a master page with telerik menu control (ID=testMenu)with  2 top level menu items "A", "B" . In the page load event of this page, I have added 3 sub menus -a1,a2,a3 to "A"   [ testMenu.Items[0].Items.Add(new RadMenuItem("a1")); testMenu.Items[0].Items.Add(new RadMenuItem("a4")); testMenu.Items[0].Items.Add(new RadMenuItem("a3"));]

  . No issues till now... now trying to get the total sub menus under "A"   from content page load event using [ (RadMenu )Master.FindControl("testMenu") ).Items[0].Items.Count] , returns '0' always  .. Can you tell me why dynamically added menu is reflected inside menu control object.

Regards
Madhu
Kevin
Top achievements
Rank 2
 answered on 15 Dec 2012
1 answer
111 views
hello all,

how to display an image (retrieved from  DB as byte[]) inside an edit form template in radgrid ??

can anyone help me ?

thanks in advance
Jayesh Goyani
Top achievements
Rank 2
 answered on 15 Dec 2012
1 answer
47 views
I am facing a issue regarding the radgrid, in which a white space is coming below the pagination. 

I had already tried the solution which is suggested by support but not working and there is no other solution found.

Below is the previous post by other developer and has screen shot attached.

            http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid---having-extra-white-space-below-the-pagination.aspx

I am having same issue and there is no solution found and the solution provided by Telerik support seems to be doesn't work.

Please help, Thanks in advanced.

Mayur
Pavlina
Telerik team
 answered on 15 Dec 2012
2 answers
153 views

private void RadGrid_InitCol()
 {
       RadGrid1.AutoGenerateColumns = false;
       RadGrid1.Columns.Clear();
       GridBoundColumn boundColumn;
  
       boundColumn = new GridBoundColumn();
       boundColumn.DataField = "id";
       boundColumn.HeaderText = "id";
       boundColumn.UniqueName = "id";
       boundColumn.HeaderStyle.Width = Unit.Pixel(60);
       boundColumn.Visible = false;
       RadGrid1.MasterTableView.Columns.Add(boundColumn);
 
       String templateColName = "SO2";
       GridTemplateColumn templateColumn;
       templateColumn = new GridTemplateColumn() {
           UniqueName = "tempCol0",
           HeaderText = templateColName,
           ItemTemplate = new MyTemplate("0", templateColName)
           //EditItemTemplate = new MyEditTemplate(templateColName)   
       };
       RadGrid1.MasterTableView.Columns.Add(templateColumn);
}

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
        if (e.Argument == string.Empty)
        {
             RadGrid1.Rebind();
             return;
        }
 
        String[] editedItemIds = e.Argument.Trim(':').Split(':');
        int i;
        for (i = 0; i < editedItemIds.Length; i++)
        {
            string id = editedItemIds[i];
            GridDataItem updatedItem = RadGrid1.MasterTableView.FindItemByKeyValue("id", int.Parse(id));
            TextBox txtBox = (TextBox)updatedItem.FindControl("txtBox");
         }
}

updatedItem["id"].Text=115102
updatedItem["tempCol0"] .Text=""  updatedItem["tempCol0"] .Controls.Count=0
-------------------------------------------------------------------------------------------------------------------------------
How to get the txtbox control?


Thanks!

Tony Liu
Top achievements
Rank 1
 answered on 15 Dec 2012
1 answer
94 views
Using the RadComboBox for the first time, I first implemented it on a test page to ensure I figured out how to implement it properly.  After a little trial & error, I got it working, displaying 2 columns of a DataTable as is shown in the first attachment.

Now I'm trying to implement it for real, which happens to be in a RadWindow dialog box.  Yet, as the 2nd attachment shows, it's not populating in the same way.  Not only does it only have just one column, but even the basic appearance of the collapsed RadComboBox is different:
  • In the test case it appeared grey in colour
  • In the RadWindow it appears white in colour, indistinguishable from the standard DropDown ListBox

What do I need to do with the RadWindow implementation to get it to populate correctly?

Robert

Robert
Top achievements
Rank 1
 answered on 15 Dec 2012
2 answers
180 views
To test out the RadComboBox I constructed a simple web page that has just this one control on it.  A small datatable (see attachment) is used to populate the control with this code:

radList.DataSource = CurrentPasses;
radList.DataTextField = "Description";
radList.DataValueField = "Master_Idx";
radList.DataBind();

My initial testing has revealed something strange: When I click on any item, the SelectedIndexChanged event is fired.

protected void radList_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)

When I check "e.Text" the correct string is shown.  But when I check "e.Value" it always displays -1.  Why isn't it showing the correct "Master_Idx" value for that row?

Am I missing something or is this a known bug in the RadComboBox?

Robert
Robert
Top achievements
Rank 1
 answered on 14 Dec 2012
6 answers
124 views
HI, 

I have keybordnavigation enabled on a RadGrid with a  FormTemplate for edition and inserting. I have several radtextbox with requiredfieldvalidators like : 

<telerik:RadTextBox ID="edDescription" runat="server" Text='<%# Bind("PPSO_DESCRIPTION") %>'
           DataType="System.String" Width="277" MaxLength="50"     SelectionOnFocus="SelectAll">                           </telerik:RadTextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="edDescription"
              ErrorMessage='<%# GetMessageEx(1744).Texte%>' runat="server" Display="Dynamic" ValidationGroup="freqValid" />

If I click my save button inside the template, the update command is not fired if edDescription is emptym but if I press ENTER key, the server event is fired. My save button looks like : 
<asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Add", "Save") %>'     CausesValidation="true" ="server"
CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update") %>' ValidationGroup="freqValid">

Is there something to perform validation on Enter key press?

Tom

Update : ok I achived make the validators to work by putting KeyboardNavigationSettings.ValidationGroup = "freqValid", but this only work in update mode, not in insert mode !?!?!
Pavlina
Telerik team
 answered on 14 Dec 2012
2 answers
183 views
I have been searching for the solution to the above scenario but couldn't find one. The details of what I need to do is as below:-

I have a RadComboBox which loads items on demand. The items are supplied by a webservice. The dropdownlist items are displayed in 2-column: the ID and Name, using ClientItemTemplate:
<telerik:RadComboBox ID="cboVendor" runat="server" EnableLoadOnDemand="true" ShowMoreResultsBox="true"
    EnableVirtualScrolling="true" Width="474px" HighlightTemplatedItems="True" EnableItemCaching="true">
    <WebServiceSettings Method="GetVendors" Path="~/services/Vendors.asmx" />
    <HeaderTemplate>
        <ul class="vendorlist">
            <li>Vendor Code</li>
            <li>Vendor Name</li>
        </ul>
    </HeaderTemplate>
    <ClientItemTemplate>
        <ul class="vendorlist">
            <li>#= Value #</li>
            <li>#= Text #</li>
        </ul>
    </ClientItemTemplate>
</telerik:RadComboBox>

While this works pretty flawless when the page is opened for inserting records (where the combobox is blank initially), I found that it is a hassle when in editing mode, where I need to set it's value initially along with all other fields on the page.

However, I have got it to work after hours of pulling hair. Not pretty but works. This is what I did :-

Set ViewState values of the item's value and text in code behind:
ViewState("VendorName") = dt.Rows(0)!vendor_name.ToString()
ViewState("VendorCode") = dt.Rows(0)!vendor.ToString()

Javascript to add the item to the ComboBox:
var vendorSet;
 
function pageLoad() {
    if (!vendorSet) {
        var text = '<%=ViewState("VendorName")%>';
        var value = '<%=ViewState("VendorCode")%>';
 
        if (value != '') addItem(text, value);
        vendorSet = true;
    }
}
 
function addItem(itemText, itemValue) {
    var item = new Telerik.Web.UI.RadComboBoxItem();
    item.set_text(itemText);
    item.set_value(itemValue);
 
    var combo = $find('<%=cboVendor.ClientID%>');
    var items = combo.get_items();
    items.add(item);
 
    item.select();
    item.bindTemplate();
}
The reason I  need the vendorSet flag is because the addItem needs to be called from pageLoad() event, and I found out that the pageLoad() event is triggered everytime during AJAX called anywhere on the page!

The reason I call the addItem() func from pageLoad() event is because there is the only point where $find('<%=cboVendor.ClientID%>'will work.

So my question is, Is there prettier and simpler ways of doing this? 

I hope I have explained the situation clear enough for you guys to reproduce and test and hopefully come up with better way of doing this. Thanks a bunch in advance!

Nencho
Telerik team
 answered on 14 Dec 2012
1 answer
33 views
Hi folks,

Brand new to the Chart control and way out of my depth. I'm not even sure that the chart can do what I want but here goes. I've attached an image showing the ideal chart. (Okay, the shadow's a frill. <grin>)

I need a chart with two series that displays the XValue (an OADate) as a formatted string and the YValues as a line. The two series will have similar Y data but dissimilar dates. Only the dates that are given should appear - not ranges.

I've pasted in some sample markup to show what the data looks like. Nothing is working so far so any tips, code, warning or solutions are most welcome.

Ken
<telerik:RadChart runat="server" ID="RadChart2" Skin="LightBrown">
               <Series>
                   <telerik:ChartSeries Name="Vendor One" Type="Line">
                       <Items>
                           <telerik:ChartSeriesItem YValue="6000" XValue="41245.211">
                           </telerik:ChartSeriesItem>
                           <telerik:ChartSeriesItem YValue="8000" XValue="41251.44">
                           </telerik:ChartSeriesItem>
 
                       </Items>
                   </telerik:ChartSeries>
                   <telerik:ChartSeries Name="Vendor Two" Type="Line">
                       <Items>
                           <telerik:ChartSeriesItem YValue="5000" XValue="41253.345">
                           </telerik:ChartSeriesItem>
                           <telerik:ChartSeriesItem YValue="9000" XValue="41254.72315">
                           </telerik:ChartSeriesItem>
                       </Items>
                   </telerik:ChartSeries>
               </Series>
               <PlotArea>
                   <XAxis >
                       <Appearance>
                           <LabelAppearance RotationAngle="70"></LabelAppearance>
                       </Appearance>
                   </XAxis>
                   <YAxis AxisMode="Extended">
                   </YAxis>
               </PlotArea>
               <ChartTitle>
                   <TextBlock Text="Chart Problem">
                   </TextBlock>
               </ChartTitle>
           </telerik:RadChart>
Petar Kirov
Telerik team
 answered on 14 Dec 2012
2 answers
120 views
Uploading ".doc" files seems to cause an issue. They get stuck on yellow 
for the upload process even though it shows 100%. If you try to continue- 
click save... It does not save the file.

Fim
Top achievements
Rank 1
 answered on 14 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?