Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
208 views
I have 3 raddockzones.  For each zone, I set my width to 33% and min-width to some px.  However, when I resize my window (IE8), raddock zone did not resize properly.  Is there a way to make a 3 relative size column raddockzone with fixed position instead of using float left?

Also, each dock title become funny looking when I change client size.  Is there something that I can do to make resize work properly (please see attached)?
Bozhidar
Telerik team
 answered on 06 Jan 2011
5 answers
240 views
 I have a  RadBinaryImage control and I want to implement a custom httphandeler but I am having a bit of trouble doing this task. The reason for my custom implementation is that  I have images stored in my DB as binary  that are 100kb in size I have a page which displays up to  170 of these images as thumbnail size but the are still 100kb in size. So at times when the page is rendered some images will not show.  
 
I tried using the AutoAdjustImageControlSize  and  ResizeMode and had not acheived  the desired effect.  I may be going about this the hard way but i wrote a handler to reduce and resize the images and spit the binary out but I can't seem to get it to work.   This is my handeler
Public Class RenderImageHandler
    Implements System.Web.IHttpHandler
  
    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
  
        Dim Response As HttpResponse = context.Response
        '  Dim ImageUrl As bi = HttpContext.Current.Server.MapPath("~/01SC087.JPG")
   
        Dim imgLoader As New PService
        Dim id As Integer
        Integer.TryParse(context.Request.QueryString("i_id"), id)
        If id > 0 Then
   
            Dim ic As New ImageConverter()
            Dim imgN As Image = DirectCast(ic.ConvertFrom(imgLoader._GetPostingImg(id)), Image)
            Dim bitmap1 As New Bitmap(imgN)
            Dim thumbnailer As New ImageThumbnailer()
  
            Dim bmp As System.Drawing.Bitmap = thumbnailer.CreateThumbnail(bitmap1, 150, 150, True)
            Dim ms As New System.IO.MemoryStream()
            bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)
            Dim imageData As Byte() = ms.GetBuffer()
  
            Response.ContentType = "image/jpeg"
            context.Response.BinaryWrite(imageData)
            context.Response.Flush()
  
        End If
    End Sub
  
    ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
        Get
            Return False
        End Get
    End Property
  
  
  
End Class



and this is my  ImageThumbnailer  class

Public Class ImageThumbnailer
    Private _thumb As Bitmap = Nothing
  
       
    Public Function CreateThumbnail(ByVal SourceImage As Bitmap, ByVal Width As Int32, ByVal Height As Int32, ByVal KeepRatio As [Boolean]) As Bitmap
        ' if Source Bitmap smaller than designated thumbnail => Return Original
        If SourceImage.Width < Width AndAlso SourceImage.Height < Height Then
            Return SourceImage
        End If
  
        Try
            Dim _Width As Int32 = 0
            Dim _Height As Int32 = 0
  
            _Width = Width
            _Height = Height
  
            If KeepRatio Then
                If SourceImage.Width > SourceImage.Height Then
                    _Width = Width
                    _Height = CType(SourceImage.Height * (Width / SourceImage.Width), Int32)
                Else
                    _Height = Height
                    _Width = CType(SourceImage.Width * (Height / SourceImage.Height), Int32)
                End If
            End If
  
            _thumb = New Bitmap(_Width, _Height)
            Using g As Graphics = Graphics.FromImage(_thumb)
                g.InterpolationMode = InterpolationMode.HighQualityBicubic
                g.FillRectangle(Brushes.White, 0, 0, _Width, _Height)
                g.DrawImage(SourceImage, 0, 0, _Width, _Height)
            End Using
        Catch
            _thumb = Nothing
        End Try
        Return _thumb
    End Function
  
      
End Class



I f i am going about this the wrong way please let me know. I want the thumb nails to be less bytes when it is rendered to the page which will increase the speed  and resolve the issue of images not being rendered.  The page in question is at the current url @  http://www.4dpeeps.com 

Nikolay Rusev
Telerik team
 answered on 06 Jan 2011
0 answers
140 views
Hi ,
here i am post my aspx page. In which i have 3 combo box list when user select the country dropdown then rad captcha image refresh plz help me out for finding the solution so that image does not refresh after select the combo box.
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlCountry">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlCountry" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlState">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlState" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlCity">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlCity" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
         
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="5">
        <table style="width: 100%; height: 100%;">
            <tr style="height: 100%">
                <td align="center" valign="middle" style="width: 100%">
                    <asp:Image ID="Image2" ImageUrl="~/Images/loading6.gif" BorderWidth="0px" Height="32px"
                        Width="32px" AlternateText="Processing Data ...." runat="server"></asp:Image></td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
    <div class="fromContainer">
        <h1>
            <asp:Label runat="server" ID="lblHeader" Text="Why I love Kiwanis" />
        </h1>
        <img src="Images/btnAdd.jpg" class="btnAdd" id="Add" />
        <div style="clear: both;">
        </div>
        <div id="panleText" class="tabPanel">
            <h2>
                Add your story and photo here!
            </h2>
        </div>
        <div id="panelMain">
            <asp:UpdatePanel runat="server" ID="UP">
                <ContentTemplate>
                    <div class="bottomBgBox">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <table class="tblBasicForm">
                                        <tr>
                                            <td>
                                                First Name
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtFirstName" CssClass="input" />
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" ControlToValidate="txtFirstName"
                                                    ErrorMessage="*" ValidationGroup="Submit" ForeColor="Red"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Last Name
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtLastName" CssClass="input" />
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="rfvLastName" runat="server" ControlToValidate="txtLastName"
                                                    ErrorMessage="*" ValidationGroup="Submit" ForeColor="Red"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Club Name
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtClub" CssClass="input" />
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="rfvClub" runat="server" ControlToValidate="txtClub"
                                                    ErrorMessage="*" ValidationGroup="Submit" ForeColor="Red"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td>
                                    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
                                     
                                     
                                            <table class="tblOptionalForm">
                                                <tr>
                                                    <td>
                                                        Country
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="ddlCountry" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlCountry_OnSelectedIndexChanged">
                                                        </telerik:RadComboBox>
                                                        <asp:RequiredFieldValidator ID="rfvDdlCountry" runat="server" ControlToValidate="ddlCountry"
                                                            Display="Dynamic" ErrorMessage="*" ValidationGroup="Submit" InitialValue="0"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        State
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="ddlState" runat="server" AutoPostBack="true" CssClass="input" OnSelectedIndexChanged="ddlState_OnSelectedIndexChanged">
                                                        </telerik:RadComboBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        City
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="ddlCity" runat="server" CssClass="input">
                                                        </telerik:RadComboBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </telerik:RadAjaxPanel>
                                     
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="discriptionBox">
                        Discription
                        <br />
                        <asp:TextBox CssClass="input" runat="server" ID="txtDiscription" TextMode="MultiLine" />
                        <asp:RequiredFieldValidator ID="rfvDescription" ControlToValidate="txtDiscription"
                            ErrorMessage="Required field can not be empty" ForeColor="Red" runat="server"
                            ValidationGroup="Submit"></asp:RequiredFieldValidator>
                             
                            <br />
                        
                        Photo Upload
                        <br /><br />
                        <telerik:RadAjaxPanel runat="server" RestoreOriginalRenderDelegate="false" >
                            <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" ControlObjectsVisibility="None"
                                TargetFolder="~/Record/">
                            </telerik:RadAsyncUpload>
                        </telerik:RadAjaxPanel>
                        <br />
                        
                             <div class="captchaText">                       
                            Enter the capcha text here
                            <asp:TextBox ID="CaptchaInput" CssClass="captchaBox" runat="server" MaxLength="5" Font-Size="13px" />                           
                            <asp:RequiredFieldValidator ID="ddd" runat="server" ControlToValidate="CaptchaInput"
                            ValidationGroup="Submit" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                 <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Height="200px" Width="300px">
                                 
                        </div>
                         <telerik:RadCaptcha ID="RadCaptcha2" runat="server" CaptchaImage-RenderImageOnly="true" CssClass="captcha"
                            CaptchaImage-BackgroundColor="#efefef" ErrorMessage="The code you entered is not valid"
                            Display="Dynamic" CaptchaTextBoxCssClass="captchaBox" ImageStorageLocation="Cache"
                            EnableViewState="true" ValidatedTextBoxID="CaptchaInput" ValidationGroup="Submit">
                        </telerik:RadCaptcha>
                         </telerik:RadAjaxPanel>
                        <asp:ImageButton runat="server" ID="btnUpload" CssClass="btnAdd" ImageUrl="~/Images/btnUpload.jpg"
                            OnClick="btnUpload_OnClick" ValidationGroup="Submit" />
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <script language="javascript" type="text/javascript">
            $(function () {
 
                $(".btnAdd").click(function () {
                    var tab = document.getElementById('panleText')
                    if (tab.style.display == "" || tab.style.display == "block") {
                        $(".tabPanel").slideUp();
                        $("#panelMain").slideDown();
                    }
                    else {
                        $(".tabPanel").slideDown();
                        $("#panelMain").slideUp();
                    }
                });
 
 
 
 
 
            })
        </script>
        </>
        
        <asp:UpdatePanel runat="server" ID="UP1">
            <ContentTemplate>
                <div id="mapContainer">
                    <h1>
                        Map
                    </h1>
                    <br />
                     <asp:UpdateProgress runat="server" ID="PageUpdateProgress" AssociatedUpdatePanelID="UP1">
                         <ProgressTemplate>
                            <div class="progressBar">
                            <img id="imgUP1" runat="server" src="~/Images/update.gif" />
                            <span>Loading ...</span>
                            </div>
                         </ProgressTemplate>
                    </asp:UpdateProgress>
                    <div>
                        <div class="gMap">
                            <cc1:GMap ID="GMap1" runat="server" Width="540" Height="400" serverEventsType="AspNetPostBack"
                                OnMarkerClick="Gmap1_OnMarkerClick" enableServerEvents="true" OnClick="Gmap1_OnClick"
                                OnZoomEnd="Gmap1_OnZoomEnd" />
                        </div>
                        <div class="regionListContainer">
                            <h3>
                                <asp:Label runat="server" ID="lblRegionListHeader" Text="Continent Regions" />
                            </h3>
                            <asp:ListBox runat="server" ID="listRegion" CssClass="regionList" OnSelectedIndexChanged="listRegion_OnSelectedIndexChanged"
                                AutoPostBack="true" />
                            <div class="listContainerBottom">
                                <img src="Images/DownArrow.jpg" />more
                            </div>
                        </div>
                    </div>
                </div>
                </div>
                <div id="descriptionContainer">
                    <asp:FormView ID="fvTestimonial" runat="server" PagerSettings-NextPageImageUrl="~/Images/btnNext.jpg" OnPageIndexChanged="btnkNextBack_OnClick"
                        AllowPaging="true" OnPageIndexChanging="fvTestimonial_OnPageIndexChanging" PagerSettings-LastPageImageUrl="~/Images/btnBack.jpg"
                        PagerSettings-Mode="NextPrevious">
                        <PagerTemplate>
                        </PagerTemplate>
                        <ItemTemplate>
                            <h1>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("City.Name") %>' />
                            </h1>
                            <div class="hr">
                                <div class="testiNavContainer">
                                    <asp:ImageButton runat="server" ID="ibtnPrevious" CommandName="Page" CommandArgument="Prev"
                                        ImageUrl="~/Images/btnBack.jpg" />
                                    <asp:ImageButton runat="server" ID="ibtnNext" CommandName="Page" CommandArgument="Next"
                                        ImageUrl="~/Images/btnNext.jpg" />
                                </div>
                            </div>
                            <div class="discription">
                                 
                                    <asp:Image runat="server" ID="imgPhoto" Width="380" CssClass="discriptionImage" ImageUrl='<%# Bind("FileUrl") %>'
                                        Visible='<%# Eval("FileUrl")!= null %>' />
                                <div style="float: left" class="discriptionText">
                                    <p>
                                        <asp:Label ID="lblDiscription" runat="server" Text='<%# Bind("Desciption") %>' />
                                    </p>
                                    <p>
                                        <asp:Label ID="lblFirstName" CssClass="highlight" runat="server" Text='<%# Bind("FirstName") %>' />
                                        <asp:Label ID="lblLastName" CssClass="highlight"  runat="server" Text='<%# Bind("LastName") %>' />,
                                        <br />
                                        <asp:Label ID="lblCity" runat="server" Text='<%# Bind("City.Name") %>' />,
                                        <asp:Label ID="lblCountry" runat="server" Text='<%# Bind("Country.Name") %>' />
                                    </p>
                                </div>
                            </div>
                            <br />
                        </ItemTemplate>
                    </asp:FormView>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
</asp:Content>
Please help me I am just need to prevent rad captha image refershing after select the drop down list.
Thanks
Deepak
Top achievements
Rank 2
 asked on 06 Jan 2011
1 answer
157 views
Hi

I am very new to the RadControls. Just a few hours in fact so go easy on me. :)

I am running what seems to be an excellent tutorial here.

Advanced ASP.NET AJAX RadScheduler Customization

At around the 38 minute mark he is using code from the Templates documentation page to demo how to set the InlineInsertTemplate on the RadScheduler.

That code looks like this.

 
<telerik:RadScheduler . . . (removed the rest of this for brevity)
            <InlineInsertTemplate>
                <p>In here</p>
                <div id="InlineInsertTemplate">
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Subject") %>'                                   Width="90%"
                                  TextMode="MultiLine" Height="20px"></
asp:TextBox>
                    <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert">
                        <asp:Image runat="server" ID="insertImage" ImageUrl="Images/ok.gif" AlternateText="insert" />
                    </asp:LinkButton>
                    <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel">
                        <asp:Image runat="server" ID="Image2" ImageUrl="Images/cancel.gif" AlternateText="cancel" />
                    </asp:LinkButton>
                    <div class="inline-label">
                        Color code:</div>
                  <br>
                    <asp:LinkButton ID="InsertMoreButton" runat="server" CommandName="More" CssClass="rsAdvancedEditLink">Edit Advanced</asp:LinkButton>
                </div>
            </InlineInsertTemplate><br>
</
telerik:RadScheduler>


However, when I run my RadScheduler, the Insert Template looks exactly as it did before I tried this code above.  As you can see above, I added a simple <p>In here</p> to the top of the template to see if it is displayed. It is not. Seems the RadScheduler ignores the InlineInsertTemplate

What am I missing here?
Brad
Top achievements
Rank 1
 answered on 06 Jan 2011
1 answer
129 views
Hi All,

I want to filter with multiple columns at once when click on comment button.

The program work fine if I'm not choice function on filter icon and just type in filtercontrols on columns then click comment button("Search").

The problem is when I choice filter function at one column it automatically postback and do searching, it's mean search one by one column.

1. The question is can I disable autopost to filtericon?
2. If can do disable, How to read filterfunction(that I have choose from every column) when I click on commentbutton to search?

Thanks and best regards.
Naunton
Top achievements
Rank 1
 answered on 06 Jan 2011
1 answer
156 views
I am using RadDateTimePicker. I have set a mindate and maxdate. Also it shows todays date. When I open the calender it shows the month of mindate. How do I get it to open current month. In .cs file,

((

RadDateTimePicker)this.FindControl("FromDatePicker")).SelectedDate = DateTime.Now;

 

 Is not working.

<telerik:GridBoundColumn DataField="DateCreated" HeaderText="Date Created"  
            UniqueName="DateCreated" FilterListOptions="VaryByDataTypeAllowCustom">
            <FilterTemplate>
                        From
                        <telerik:RadDateTimePicker ID="FromDatePicker" runat="server" Width="185px" Skin="WebBlue" DateInput-EmptyMessage="MinDate"
                            MinDate="01-01-2010" MaxDate="12-31-2011"  DbSelectedDate='<%# startDate1 %>'>
                            <TimeView ID="TimeView1" OnClientTimeSelected="DateSelected" runat="server">
                            </TimeView>
                             <ClientEvents OnDateSelected="DateSelected1" OnPopupOpening="PopupOpening" />
                             <Calendar runat="server"
                             <SpecialDays> <telerik:RadCalendarDay Repeatable ="Today" ItemStyle-BackColor="Red"
                             </telerik:RadCalendarDay></SpecialDays>
                             </Calendar>
                        </telerik:RadDateTimePicker>
                        to
                        <telerik:RadDateTimePicker ID="ToDatePicker" runat="server" Width="185px" MinDate="01-01-2010" Skin="WebBlue" DateInput-EmptyMessage="MinDate"
                            MaxDate="12-31-2011"  DbSelectedDate='<%# endDate1 %>'>
                            <TimeView ID="TimeView2" OnClientTimeSelected="DateSelected" runat="server" >
                            </TimeView>
                             <ClientEvents OnDateSelected="DateSelected1"  OnPopupOpening="PopupOpening" />
                             <Calendar ID="Calendar1" runat="server">
                             <SpecialDays> <telerik:RadCalendarDay Repeatable ="Today" ItemStyle-BackColor="Red">   
                             </telerik:RadCalendarDay></SpecialDays>
                             </Calendar>
                        </telerik:RadDateTimePicker>
                        <telerik:RadScriptBlock ID="RadScriptBlock111" runat="server">
  
                            <script type="text/javascript">
                                function DateSelected(sender, args) {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("DateCreated", "", "Between");
                                }
                                var isDateToBeSet = true;
                                function DateSelected1(sender, args) {
                                    if (isDateToBeSet) {
                                        sender.get_timeView().setTime(00, 01, 0, null);
                                    }
                                }
                                function PopupOpening(sender, args) {
                                    isDateToBeSet = args.get_popupControl().get_id().indexOf("timeView") != -1 ? false : true;
  
                                }
                            </script> </telerik:RadScriptBlock>
                    </FilterTemplate>
            <HeaderStyle Font-Bold="True" />
            <ItemStyle Width="31%" />
        </telerik:GridBoundColumn>
Please help.
Shinu
Top achievements
Rank 2
 answered on 06 Jan 2011
1 answer
114 views
I am using GridClientSelectColumn and I have to call ClientEvents on checkbox click not onRowSelected.

<ClientEvents OnRowSelected="onSelected" OnRowDeselected="OnDeselected" />

Client events takes two arguments sender, args. If i add attribute on checkbox on server side then how can i pass (sender, args) parametes to get  args._dataKeyValues.

GridDataItem dataitem = (GridDataItem)e.Item;
CheckBox checkbox = (CheckBox)dataitem["column"].Controls[0];
checkbox.Attributes.Add("onclick", "onselect()");

How can i do this?
Princy
Top achievements
Rank 2
 answered on 06 Jan 2011
1 answer
216 views
I  have a complex scenario where I have a RadGrid that contains a GridTableView, and that GridTableView needs a RadComboBox in the CommandItemTemplate whose item list needs to load dynamically based on the selected item in the parent grid.  When an item is selected in the combo, it needs to insert a record into the GridTableView.  The grid looks something like:

<telerik:RadGrid ID="MeetingRoomsGrid" runat="server" OnDetailTableDataBind="MeetingRoomsGrid_DetailTableDataBind">
    <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="Id" EditMode="InPlace" InsertItemPageIndexAction="ShowItemOnFirstPage">
        <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" ShowExportToPdfButton="true" ShowExportToCsvButton="true" />
        <DetailTables>
            <telerik:GridTableView DataKeyNames="Id" Name="Aggregates" Width="100%" AllowSorting="true" AllowFilteringByColumn="true" CommandItemDisplay="Top">
                <CommandItemTemplate>
                    <div style="float: right;">
                        <telerik:RadComboBox  ID="AggregateRoomCombo" runat="server" AutoPostBack="true" OnSelectedIndexChanged="AggregateRoomCombo_SelectedIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="foo" />
                                <telerik:RadComboBoxItem Text="bar" />
                            </Items>
                        </telerik:RadComboBox>

                    </div>
                    <div class="clearfix">&nbsp;</div>
                </CommandItemTemplate>
                <Columns>
                    <telerik:GridBoundColumn DataField="ChildName" DataType="System.String" UniqueName="ChildName" SortExpression="ChildName" />
                    <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" ButtonType="ImageButton">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="ImageButton">
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridEditCommandColumn>
            <telerik:GridTemplateColumn DataField="Name"
                DataType="System.String"
                UniqueName="Name"
                SortExpression="Name"
                DefaultInsertValue="New Meeting Room"
                ItemStyle-Width="210">
                <ItemTemplate>
                    <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' />
                </ItemTemplate>
           </telerik:GridTemplateColumn>
       </Columns>
    </MasterTableView>
</telerik:RadGrid>

(I have stripped out a bunch of stuff to try to pare it down to the essential essence)

So on the MeetingRoomsGrid_DetailDataBind() event I need to find the AggregateRoomCombo and load items into it based on the Id of the selected data item in the grid, and on the AggregateRoomCombo_SelectedIndexChanged() event I need to insert a new record into the detail table based on the Id of the selected data item in the grid.

Can anyone tell me how to traverse the grid object model to 1) find the AggregateRoomCombo object in the detail table, and 2) traverse backwards from the AggregateRoomCombo up to the grid to find the Id of the selected data item?
Ron Miles
Top achievements
Rank 1
 answered on 06 Jan 2011
4 answers
226 views
I am using the RadEditor in the admin section of an application that uses ASP.NET 4 routing. I am having some problems getting the editor to work correctly with the routes. I have made some progress resolving the problems following the instructions in this blog post: http://www.scottfindlater.co.uk/blog/net-4-routing-and-telerik-editor-dialogue-handlers, however, I still get the following error when I attempt to access any of the resource manager dialogues (eg ImageManager). Please can you tell me what is causing the problem and how to solve it. Details of Editor implementation below the error trace.

Exception Trace
[TypeAccessException: Attempt by method 'DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure)' to access type 'Telerik.Web.UI.GridDataTableFromEnumerable+GridGenericEnumerable`1<System.Data.DataRowView>' failed.]
lambda_method(Closure ) +22
System.Linq.EnumerableExecutor`1.Execute() +94
System.Linq.EnumerableExecutor`1.ExecuteBoxed() +23
System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +94
Telerik.Web.UI.GridDynamicQueryable.Count(IQueryable source) +143
Telerik.Web.UI.GridDataTableFromEnumerable.FillData35() +216
Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +758
Telerik.Web.UI.GridResolveEnumerable.Initialize() +35
Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +24
Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, DataView dataView, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +203
Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +76
Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +98
Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +151
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +33
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +66
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
Telerik.Web.UI.GridTableView.PerformSelect() +4
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
Telerik.Web.UI.GridTableView.DataBind() +259
Telerik.Web.UI.RadGrid.DataBind() +87
Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +2342
Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146

RadGrid use in page:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

        <telerik:RadEditor ID="editContent" runat="server">
        </telerik:RadEditor>

Skin file:
<telerik:RadEditor runat="server" Width="100%" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.aspx" />

Programatic configuration of editor in codebehind:

        Private Sub SetupPage()
            editContent.MediaManager.ViewPaths = New String() {Config.MediaDirectory}
            editContent.MediaManager.UploadPaths = New String() {Config.MediaDirectory}
            editContent.MediaManager.DeletePaths = New String() {Config.MediaDirectory}
            editContent.ImageManager.ViewPaths = New String() {Config.ImageDirectory}
            editContent.ImageManager.UploadPaths = New String() {Config.ImageDirectory}
            editContent.ImageManager.DeletePaths = New String() {Config.ImageDirectory}
            editContent.FlashManager.ViewPaths = New String() {Config.FlashDirectory}
            editContent.FlashManager.UploadPaths = New String() {Config.FlashDirectory}
            editContent.FlashManager.DeletePaths = New String() {Config.FlashDirectory}
            editContent.DocumentManager.ViewPaths = New String() {Config.DownloadDirectory}
            editContent.DocumentManager.UploadPaths = New String() {Config.DownloadDirectory}
            editContent.DocumentManager.DeletePaths = New String() {Config.DownloadDirectory}
            Dim templateDirectory As String = String.Format("{0}/Editor", Config.TemplateDirectory)
            editContent.TemplateManager.ViewPaths = New String() {templateDirectory}
            editContent.TemplateManager.UploadPaths = New String() {templateDirectory}
            editContent.TemplateManager.DeletePaths = New String() {templateDirectory}
        End Sub
Paul Taylor
Top achievements
Rank 1
 answered on 05 Jan 2011
1 answer
143 views

Greetings,

I am able to get a reference to the radGrid,

 

But in the VS Immediate Window:

 

 

radGrid.MasterTableView.Items.count

 

returns zero,

but I have several rows of data in grid.

On Postback what am I missing here?

 

Thanks

 

Dave G / Ft. Worth Tx.



   protected void btnNext_Click(object sender, ImageClickEventArgs e)

        {

 

 

 

            RadGrid radGrid = FindControl("rdTinExcel") as RadGrid;

 

            foreach (GridDataItem dataItem in radGrid.MasterTableView.Items) 

           {

 

                // push Rowa that are not Checked in the Grid  

                if (!(dataItem.FindControl("cbSelectColumn") as CheckBox).Checked)

                {

 

Do something here…..

 

}

Todd Anglin
Top achievements
Rank 2
 answered on 05 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?