Telerik Forums
UI for WinForms Forum
1 answer
89 views

Hello. I have an user control and i want to use it twice on same page. This is the UC.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ImageManagerCtrl.ascx.cs"
    Inherits="SitefinityWebApp.Application.Backend.Controls.ImageManagerCtrl" %>
<script type="text/javascript">
   
function cellSelected(sender, args) {
       
var mediaUrl = args.get_gridDataItem().getDataKeyValue("MediaUrl");
        document
.getElementById("<% =hdnMediaUrl.ClientID %>").value = mediaUrl;
   
}

   
function cellDeselected(sender, args) {
   
var mediaUrl = args.get_gridDataItem().getDataKeyValue("MediaUrl");
    document
.getElementById("<% =hdnMediaUrl.ClientID %>").value = '';
   
}
   
</script>
<asp:Panel runat="server" ID="pnlMedia">
   
<asp:HiddenField runat="server" ID="hdnMediaUrl" ClientIDMode="Static" />
   
<asp:DropDownList ID="lstAlbums" runat="server" Width="100%" OnSelectedIndexChanged="lstAlbums_SelectedIndexChanged"
       
AutoPostBack="True" />
   
<br />
   
<telerik:RadGrid ID="grdPhotos" runat="server" GridLines="None" Skin="Sitefinity"
       
OnItemDataBound="grdPhotos_ItemDataBound">
       
<MasterTableView CssClass="listItems" AutoGenerateColumns="false" DataKeyNames="Id, MediaUrl"
           
ClientDataKeyNames="Id, MediaUrl">
           
<Columns>
                          bla bla bla
           
</Columns>
       
</MasterTableView>
   
</telerik:RadGrid>
</asp:Panel>

And here is the page where i need.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Edit.ascx.cs" Inherits="SitefinityWebApp.Application.Backend.Affinia.Slides.Edit" %>
<%@ Register TagPrefix="uc" Src="../../Controls/ImageManagerCtrl.ascx" TagName="ImageManagerCtrl" %>
<asp:HiddenField ID="hdnItemId" runat="server" />
<fieldset class="sfNewContentForm agnesianContentForm">
   
<ul>
       
<li class="sfFormSeparator">
           
<uc:ImageManagerCtrl ID="imageManagerBackground" runat="server" />
       
</li>
       
<li class="sfFormSeparator">
           
<uc:ImageManagerCtrl ID="imageManagerForeground" runat="server" />
       
</li>
   
</ul>
</fieldset>  

I need in the second form the address for one image clicked in the first user control and one from the second user control. The address is stored in the hidden field and is returned with if(!string.IsNullOrEmpty(hdnMediaUrl.Value)) return hdnMediaUrl.Value; from code behind.

My problem is that only the second ImageManager works. The second one, when is clicked, run as the first one. I found that usint alert( "<%=this.ClientID%>"); in cellSelected function. Everytime it show foreground's user control id.

I tryed to change ClientIdMode, tryed everithing i know to do. Something interesting is that if i change the position of user controls, the second one is used too. Is like i have just one of them.

I spent hours trying to solve this problem and no help. 

Thanks for you help.


Tsvetina
Telerik team
 answered on 09 Oct 2012
1 answer
204 views
Hi
I use RadScrollablePanel in my app. In runtime add many buttons. In other list when user select name of button, RadScrollablePanel scroll to button. how can i do this? RadScrollablePanel is AutoScroll enabled.
I use this code too : 
Point btnpos = new Point(itemButton.Location.X,itemButton.Location.Y);
PanelOfEachGroup.VerticalScrollbar.PerformScrollTo(btnpos);

and:
PanelOfEachGroup.ScrollControlIntoView(btnpos);

btnpos is the button in RadScrollablePanel.
Thanks.
Anton
Telerik team
 answered on 09 Oct 2012
0 answers
131 views

Hello All,

                I am using Sitefinity 5.1.

                I have a project with there is main site and also prepare separate Mobile site for different Smartphone and tablets.

                I have created rules and also I have set up that root of that Mobile site in this.

                Main site: www.mysite.com

                Mobile site: www.mysite.com/mobile                  

So when I have testing with smart phones and a tablet it takes to me with Mobile site
but the problem is when I have test with desktop or Notebook it redirect to me on mobile site. It should take to on Main site.

SO how can I do with this open default site like www.mysite.com  on desktop or Notebook and www.mysite.com/mobile on smart phones and tablets?

Its urgent please replays me ASAP.

Thanks In Advance!!!
Jignesh Gohil

Jignesh
Top achievements
Rank 1
 asked on 09 Oct 2012
1 answer
153 views
I have a grid containing a GridViewMaskBoxColumn.  I want the mask on the cell to change when I hit the F4 key with the cell editor active.  Unfortunately when I change the column's Mask in the RadMaskedEditBoxEditorElement's KeyUp event handler while the editor is open it doesn't have an immediate effect; I have to switch to a different cell before the new mask takes effect.  How do I get the mask change to take immediate effect in the editor?
Peter
Telerik team
 answered on 09 Oct 2012
3 answers
240 views

Hi,

I'm writing a demo app that has a split container with a left panel that contains a tree, which is used for navigation, and a centre panel.
When a user selects a node on the tree the corresponding User Control is then displayed on the centre panel.

What I would like to do is add some animation to the User Control so that it slides in / out of the centre panel.
Is this possible?

I got this idea from your DemoHub App, but instead of using the RadPanorama control I would like to use the SplitContaining.

I suppose the overall goal is to produce a smooth loading of the UserControl, just now it's a bit jumpy, so if it was animated the overall experience might be improved.

Cheers

Shaun


Ivan Todorov
Telerik team
 answered on 09 Oct 2012
2 answers
563 views
Hello,

I am experimenting with your controls before we buy them and have a question. I have a class (for sake of demo I have simplified it) that I am binding to a RadListView via a binding list. Can I prevent the Badge column from appearing in the list view? The listview is actually used to display many different types of data so I would prefer a method that did not involve me manually hiding the column.

 Public Class Visitor
        Friend Sub New(name As String, arrival As Date, department As String, badge As Integer)
            _Name = name
            _ArrivalTime = arrival
            _Department = department
            _Badge = badge
        End Sub

        Private _Name As String
        Public ReadOnly Property Name As String
            Get
                Return _Name
            End Get
        End Property

        Private _ArrivalTime As Date
        Public ReadOnly Property ArrivalTime As Date
            Get
                Return _ArrivalTime
            End Get
        End Property

        Private _Department As String

        Public ReadOnly Property Department As String
            Get
                Return _Department
            End Get
        End Property

        Private _Badge As Integer
        Public ReadOnly Property Badge As Integer
            Get
                Return _Badge
            End Get
        End Property
    End Class

Thank You.
Ivan Todorov
Telerik team
 answered on 09 Oct 2012
5 answers
211 views
Have set HelpButton = True for the RadRibbonForm but unable to get the HelpButton to appear - what other settings need to be changed?(using 2012 Q2)
Anton
Telerik team
 answered on 09 Oct 2012
1 answer
79 views
how can i create hirarchical grid using Generic list. Can anybody provide example for it.
Nikolay
Telerik team
 answered on 09 Oct 2012
1 answer
85 views
sorry problem was with old references.
Nikolay
Telerik team
 answered on 09 Oct 2012
1 answer
84 views
I've created a simple RadGridView with 2 columns and turned off displaying grid lines and I get the following error:

Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.GridRowElement.UpdateSelectedState()

 
Seems that setting display.HideSelection=true causes BestFit to raise the error.

Here's the code that reproduces the problem:

private void GenerateConfigurationSummary(RadGridView display)
{
    const string colValue = "value";
    const string colHeader = "header";
    
    display.HideSelection = true;
    display.Rows.Clear();
    display.Columns.Clear();
    display.Columns.Add(colHeader);
    display.Columns.Add(colValue);
    display.ReadOnly = true;
    display.ShowColumnHeaders = false;
    display.ShowRowHeaderColumn = false;
    display.TableElement.DrawBorder = false;
 
    display.CellFormatting += (s, e) =>
    {
        if (e.Column.Name == colHeader)
            e.CellElement.Font = new System.Drawing.Font(e.CellElement.Font, System.Drawing.FontStyle.Bold); 
 
        e.CellElement.DrawBorder = false
    };
 
    try
    {
        display.Rows.Add("Test Row 1", "Test Value 1");
        display.Rows.Add("Test Row 2", "Test Value  larger line goes here");
        display.Rows.Add("Test Row 3", "Test Value 1");
 
        foreach (var col in display.Columns)
            col.BestFit();
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.WriteLine("Error Formatting Display: " + ex.ToString());
    }
}

 

 

 

 

Stefan
Telerik team
 answered on 09 Oct 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
NavigationView
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?