Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
162 views
I have a RadComboBox with CheckBoxes set true.  How do I trigger a server side event when the ComboBox closes?
Princy
Top achievements
Rank 2
 answered on 23 Jan 2013
1 answer
133 views
Hi there,

I have a problem in using the radGrid in combination with user controls.

As you can see in the enclosed image (=Image1.png) I want to show some part detail infomation to the user by clicking the expand button of the grid.
The image shown is populated by a user control which is added to the placeholder in the code behind.

When I click the expand button for another part the image of the previous part disappears (=Image2.png)

I use the following code:
<NestedViewTemplate>
                    <asp:Panel ID="paPart" runat="server" GroupingText="Part info">
                     
                        <table width="100%">
                            <tr>
                                 
                                <!--Empty-->
                                <td width="5%"></td>
                                 
                                <!--Part detail-->
                                <td width="45%" valign="top">
                                    <table>
                                        <tr>
                                            <td>Partnumber:</td>
                                            <td><asp:Label ID="laPartnumber" runat="server"></asp:Label></td>
                                        </tr>
                                        <tr>
                                            <td>Description:</td>
                                            <td><asp:Label ID="laDescription" runat="server"></asp:Label></td>
                                        </tr>
                                        <tr>
                                            <td>Weight:</td>
                                            <td><asp:Label ID="laWeight" runat="server"></asp:Label></td>
                                        </tr>
                                        <tr>
                                            <td>Volume:</td>
                                            <td><asp:Label ID="laVolume" runat="server"></asp:Label></td>
                                        </tr>
                                        <tr>
                                            <td>Package quantity:</td>
                                            <td><asp:Label ID="laPackageQuantity" runat="server"></asp:Label></td>
                                        </tr>
                                        <tr>
                                            <td>Unit of measure:</td>
                                            <td><asp:Label ID="laUnitOfMeasure" runat="server"></asp:Label></td>
                                        </tr>
                                    </table>
                                </td>
                                 
                                <!--Images met Lightbox-->
                                <td align="center" width="50%">
                                    <table width="100%">
                                        <tr>
                                            <td valign="top"><asp:PlaceHolder ID="phPartImage" runat="server"></asp:PlaceHolder></td>
                                            <td>  </td>
                                            <td valign="top"><asp:PlaceHolder ID="phPartImageOther" runat="server"></asp:PlaceHolder></td>
                                        </tr>                                                                                                           
                                    </table>
                                </td>
                            </tr>
                        </table>
                     
                    </asp:Panel>
                </NestedViewTemplate>
 
            </MasterTableView>

protected void grPart_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == Telerik.Web.UI.RadGrid.ExpandCollapseCommandName)
            {
                Telerik.Web.UI.GridDataItem Item = e.Item as Telerik.Web.UI.GridDataItem;
 
                if (!Item.Expanded)
                {
                    Telerik.Web.UI.GridNestedViewItem NestedItem = (Telerik.Web.UI.GridNestedViewItem)Item.ChildItem;
 
                    //get part
                    NMHG.Data.Part.Part.Part Part = new NMHG.Data.Part.Part.Part();
                    Part.Partnumber = Item.GetDataKeyValue("Partnumber").ToString();
                    Part.GetPart();
 
                    //Partnumber
                    Label laPartnumber = (Label)NestedItem.FindControl("laPartnumber");
                    laPartnumber.Text = Part.Partnumber;
 
                    //Description
                    Label laDescription = (Label)NestedItem.FindControl("laDescription");
                    laDescription.Text = Part.Description;
 
                    //Weight
                    Label laWeight = (Label)NestedItem.FindControl("laWeight");
                    laWeight.Text = Part.Weight.ToString();
 
                    //Volume
                    Label laVolume = (Label)NestedItem.FindControl("laVolume");
                    laVolume.Text = Part.volume.ToString();
 
                    //Package quantity
                    Label laPackageQuantity = (Label)NestedItem.FindControl("laPackageQuantity");
                    laPackageQuantity.Text = Part.Package_Qty.ToString();
 
                    //Unit of measure
                    Label laUnitOfMeasure = (Label)NestedItem.FindControl("laUnitOfMeasure");
                    laUnitOfMeasure.Text = Part.Unit_of_Measure.ToString();
 
                    //Images
 
                    //get files image directory
                    bool PHOTO_FIRST = true;        //1 of meerdere foto's
                    string FILENAME = Part.Partnumber.Replace(" ", "") + "*.jpg";
                    string DIRECTORY = ConfigurationManager.AppSettings.Get("DIR part images");
                    DirectoryInfo DIRINFO = new DirectoryInfo(DIRECTORY);
                    FileInfo[] BESTANDEN = DIRINFO.GetFiles(FILENAME);
                    foreach (FileInfo BESTAND in BESTANDEN)
                    {
                        //creeer usercontrol PartImage
                        Part.User_controls.PartImage PartImage = (Part.User_controls.PartImage)LoadControl("PartImage.ascx");
                        PartImage.FILENAME = Path.GetFileNameWithoutExtension(BESTAND.Name) + "*.jpg";
                        PartImage.DESCRIPTION = Part.Partnumber + " - " + Part.Description;
                        PartImage.THUMBNAIL = false;                                            //Use/show thumbnail
 
                        if (PHOTO_FIRST == true)
                        {
                            PartImage.WIDTH = 200;
                            PartImage.HEIGHT = 200;
                            PartImage.PARTIMAGE_FILL();
 
                            //add user control to placeholder
                            PlaceHolder phPartImage = (PlaceHolder)NestedItem.FindControl("phPartImage");
                            phPartImage.Controls.Add(PartImage);
                        }
                        else
                        {
                            PartImage.WIDTH = 50;
                            PartImage.HEIGHT = 50;
                            PartImage.PARTIMAGE_FILL();
 
                            //add user control to placeholder other
                            PlaceHolder phPartImageOther = (PlaceHolder)NestedItem.FindControl("phPartImageOther");
                            phPartImageOther.Controls.Add(PartImage);
 
                            //set empty row
                            Label label = new Label();
                            label.Height = Unit.Pixel(20);
                            phPartImageOther.Controls.Add(label);
                        }
 
                        PHOTO_FIRST = false;
                    }
                }
            }
        }


Any idea?

Many thanx!

Marcel
Jayesh Goyani
Top achievements
Rank 2
 answered on 23 Jan 2013
2 answers
160 views
Hi
     I want to empty my grid on a button click. How shall I have it done?? Please share something helpful
thanks
Allen
Jayesh Goyani
Top achievements
Rank 2
 answered on 23 Jan 2013
5 answers
138 views
Hello,

I want to prevent the user from grouping when the grid is currently in edit or insert mode.
For the sort command, I did this in GridItemCommand:

public bool IsInEditMode
      {
         get { return MasterTableView.IsItemInserted || EditItems.Count > 0; }
      }
 
 
private void _GridItemCommand(object sender, GridCommandEventArgs e)
{
     if (IsInEditMode &&
             e.CommandName == RadGrid.SortCommandName)
         {
            e.Canceled = true;
         }

But the grouping won't call the GridItemCommand event handler. How can I cancel the grouping?
Shinu
Top achievements
Rank 2
 answered on 23 Jan 2013
4 answers
168 views
Hi,

My Scenario is , I have a RadList box with Checkboxes="true" property and a button . If user click on button with out check any item from the radList box then I have to show an error message. For this I used Custom Validator function and Specified Same validator Group name for CustomValidator and Button. But this Custom Validator function is executing by check/Uncheck the Items in the RadList Box.

My Code Snippet is :-

function Is_Event_selected(sender, args) {

 

debugger;

 

var lstbox = $find("lstEvents");

 

var chkedItems_Count = lstbox.get_checkedItems().length;

args.IsValid = chkedItems_Count > 0;

}


<div>

 

<asp:CustomValidator ID="CV_lstEvents" runat="server" ValidateEmptyText="true" ClientValidationFunction="Is_Event_selected"

 

ControlToValidate="lstEvents" ErrorMessage="please Select Items(s)" ValidationGroup="Event_Group_Validation">

 

</asp:CustomValidator>

 

<telerik:RadListBox ID="lstEvents" runat="server" Width="100%" MaxHeight="225px"

 

CheckBoxes="true" AutoPostBack="false" EmptyMessage="Select Event" CausesValidation="false" >

 

<Items>

 

<telerik:RadListBoxItem Text="Ajax Controls" Value="0" />

 

<telerik:RadListBoxItem Text="BI Controls" Value="1" />

 

<telerik:RadListBoxItem Text="SilverLight" Value="2" />

 

<telerik:RadListBoxItem Text="KenDo UI" Value="3" />

 

</Items>

 

</telerik:RadListBox>

 

<asp:Button ID="btn" runat="server" ValidationGroup="Event_Group_Validation" />

 

</div>

Jayesh Goyani
Top achievements
Rank 2
 answered on 23 Jan 2013
3 answers
184 views
Hi ... I'm trying to put in a confirmation popup when a user tries to move from a tab to a different one - the popup box is mainly to ask if they want to save their data or not or cancel the tab move. A code snippet is below (my company is still on the classic RadTabStrip - RadTabStrip.Net2):

var tabConfirmResult;
 
 
function onClientTabSelecting(sender, eventArgs) {
 OpenConfirmIfIsDirty('MilestonesTab', clientJobTabCallback); // Displays the radconfirm
 if (tabConfirmResult == 'cancel') {
     return false;
 }
}
 
 
function clientJobTabCallback(radWindow, returnValue) {
 tabConfirmResult = radWindow;
 if(radWindow=='cancel') {
     return;
 } else {
     if (radWindow == true) {
         // Do processing here for Save.
     }
     return;
 }
}


The problem is that after calling on the 'OpenConfirmIfIsDirty' function, the code goes straight to the next lines, finishes this function and goes to the next tab while the radconfirm page is still displayed in the foreground.

How do I make it wait for the user to click on the radconfirm popup?



Kwok (Andrew)
Top achievements
Rank 1
 answered on 22 Jan 2013
4 answers
87 views
This is not life or death but I was wondering if it was possible to control the orientation of individual ticks on a RadSlider.  (The RadSlider itself has to be oriented horizontally.)

For example, I have one displaying a range of years so instead of displaying '2012' I'd like it to display
2
0
1
2.

Thanks.
Boris
Top achievements
Rank 1
 answered on 22 Jan 2013
5 answers
308 views
I'm wondering if I'm missing something basic.  I've just roughed out an ascx that contains RadTextBoxes, a RadDatePicker, a RadListBox, and an Asp.Net Repeater that contains RadButtons. 

An instance of the control has been hard-coded into a page inside a RadPane.  (Part of a page with multiple SplitterBar sections.)
As yet I've done no real coding with it, server or client side.

The reason I've posted is primarily because the RadDatePicker popup doesn't appear to be working, at least not consistently.  

Also, while the textboxes appear to allow input, most of the controls on the page appear to have a pair of tiny parallel diagonal lines at the far right hand bottom corner.  

Further information:  After some trial and error it appears that the problem was that the ordinary HTML table the controls were in had a resize setting in it's Style attribute.  ??????
Boris
Top achievements
Rank 1
 answered on 22 Jan 2013
5 answers
126 views
Hi,
        I have three rating controls on a page two standard and one using custom images. The standard controls work fine in IE9 but the custom controls flickers on mouse over and mouse move, it is not just the item under the cursor but all of the items that flicker randomly.  Seems OK on other browsers (have checked IE8, Chrome and FF9 and there is no flickering).

The images are all png and are 22px x 22px and about 1k in size.

I am using the Q1 2012 .NET 4.0 controls, on IIS 7.5 on Windows Server 2008R2.

Do you have any ideas?

Thanks

Chris
Markup:
<div id="score_entry">
    <div id="grade" style="float: left">
        Predicted Grade:
        <telerik:RadRating ID="Predication" runat="server" Orientation="Horizontal" ItemHeight="22px"
                           ItemWidth="22px" ItemCount="7" SelectionMode="Single">
            <Items>
                <telerik:RadRatingItem Value="0" HoveredImageUrl="/Images/grades/snograde.png" HoveredSelectedImageUrl="/Images/grades/snograde.png"
                                       SelectedImageUrl="/Images/grades/snograde.png" ImageUrl="/Images/grades/unograde.png"
                                       ToolTip="No Grade" />                                            
                <telerik:RadRatingItem Value="7" HoveredImageUrl="/Images/grades/sS.png" HoveredSelectedImageUrl="/Images/grades/sS.png"
                                       SelectedImageUrl="/Images/grades/sS.png" ImageUrl="/Images/grades/uS.png"
                                       ToolTip="A*" />
                <telerik:RadRatingItem Value="6" HoveredImageUrl="/Images/grades/sA.png" HoveredSelectedImageUrl="/Images/grades/sA.png"
                                       SelectedImageUrl="/Images/grades/sA.png" ImageUrl="/Images/grades/uA.png"
                                       ToolTip="A" />
                <telerik:RadRatingItem Value="5" HoveredImageUrl="/Images/grades/sB.png" HoveredSelectedImageUrl="/Images/grades/sB.png"
                                       SelectedImageUrl="/Images/grades/sB.png" ImageUrl="/Images/grades/uB.png"
                                       ToolTip="B" />
                <telerik:RadRatingItem Value="4" HoveredImageUrl="/Images/grades/sC.png" HoveredSelectedImageUrl="/Images/grades/sC.png"
                                       SelectedImageUrl="/Images/grades/sC.png" ImageUrl="/Images/grades/uC.png"
                                       ToolTip="C" />
                <telerik:RadRatingItem Value="3" HoveredImageUrl="/Images/grades/sD.png" HoveredSelectedImageUrl="/Images/grades/sD.png"
                                       SelectedImageUrl="/Images/grades/sD.png" ImageUrl="/Images/grades/uD.png"
                                       ToolTip="D" />
                <telerik:RadRatingItem Value="2" HoveredImageUrl="/Images/grades/sE.png" HoveredSelectedImageUrl="/Images/grades/sE.png"
                                       SelectedImageUrl="/Images/grades/sE.png" ImageUrl="/Images/grades/uE.png"
                                       ToolTip="E" />                                                                                                                                                                                                            
                <telerik:RadRatingItem Value="1" HoveredImageUrl="/Images/grades/sU.png" HoveredSelectedImageUrl="/Images/grades/sU.png"
                                       SelectedImageUrl="/Images/grades/sU.png" ImageUrl="/Images/grades/uU.png"
                                       ToolTip="U" />
            </Items>
        </telerik:RadRating>
    </div>
    <div id="classeffort" style="float: left">
        Class Effort:
        <telerik:RadRating ID="rrClassEffort" runat="server">
        </telerik:RadRating>
    </div>
    <div id="prerpeffort" style="float: left">
        Prep Effort:
        <telerik:RadRating ID="rrPrepEffort" runat="server">
        </telerik:RadRating>
    </div>
</div>
Chris
Top achievements
Rank 2
 answered on 22 Jan 2013
1 answer
103 views
Hello,

RadEditor is automatically converting <strong> section to font size 16, like  <strong style="font-size:16px;"> , and because of this, the follow up content's font is also getting 16px. I am not using font-size tool in RadEditor, then why it is changing the font size automatically? Is there any way to completely discard font size from the content RadEditor, so that when I will get the content, there will not any font specified in the HTML part?
Rumen
Telerik team
 answered on 22 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?